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, ""; + } + } + + return menu; + } + + return null; + } + + public static string GetPageMenu(System.Web.UI.Page page) + { + if(page != null) + { + string menu = string.Empty; + + Collection menuCollection = MixERP.Net.BusinessLayer.Core.Menu.GetMenuCollection(page.Request.Url.AbsolutePath, 1); + + if(menuCollection.Count > 0) + { + foreach(MixERP.Net.Common.Models.Core.Menu model in menuCollection) + { + menu += string.Format(System.Threading.Thread.CurrentThread.CurrentCulture, ""; + } + } + + menu += "
"; + return menu; + } + + return null; + } + } +} diff --git a/MixERP.Net.BusinessLayer/Helpers/ReportHelper.cs b/MixERP.Net.BusinessLayer/Helpers/ReportHelper.cs new file mode 100644 index 000000000..7931cc4d6 --- /dev/null +++ b/MixERP.Net.BusinessLayer/Helpers/ReportHelper.cs @@ -0,0 +1,180 @@ +/******************************************************************************** +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.Collections.Specialized; +using System.Data; +using System.Data.SqlClient; +using System.Linq; +using System.Text; +using System.Text.RegularExpressions; +using System.Web; + +namespace MixERP.Net.BusinessLayer.Helpers +{ + public static class ReportHelper + { + public static DataTable GetDataTable(string sql, Collection> parameters) + { + return MixERP.Net.DatabaseLayer.Helpers.ReportHelper.GetDataTable(sql, parameters); + } + + public static string Parse(string expression) + { + if(string.IsNullOrWhiteSpace(expression)) + { + return string.Empty; + } + + expression = expression.Replace("{LogoPath}", MixERP.Net.Common.PageUtility.GetCurrentDomainName() + MixERP.Net.Common.PageUtility.ResolveUrl("~/Themes/purple/mixerp-logo-light.png")); + expression = expression.Replace("{PrintDate}", System.DateTime.Now.ToString()); + + foreach(var match in Regex.Matches(expression, "{.*?}")) + { + string word = match.ToString(); + + + if(word.StartsWith("{Session.", StringComparison.OrdinalIgnoreCase)) + { + string sessionKey = RemoveBraces(word); + sessionKey = sessionKey.Replace("Session.", ""); + sessionKey = sessionKey.Trim(); + expression = expression.Replace(word, GetSessionValue(sessionKey)); + } + else if(word.StartsWith("{Resources.", StringComparison.OrdinalIgnoreCase)) + { + string res = RemoveBraces(word); + string[] resource = res.Split('.'); + + expression = expression.Replace(word, MixERP.Net.Common.Helpers.LocalizationHelper.GetResourceString(resource[1], resource[2])); + } + } + + return expression; + } + + public static string RemoveBraces(string expression) + { + if(string.IsNullOrWhiteSpace(expression)) + { + return string.Empty; + } + + return expression.Replace("{", "").Replace("}", ""); + } + + public static string GetSessionValue(string key) + { + var val = HttpContext.Current.Session[key]; + + if(val != null) + { + return val.ToString(); + } + + return string.Empty; + } + + public static Collection>> BindParameters(string reportPath, Collection> parameterCollection) + { + if(!System.IO.File.Exists(reportPath)) + { + return null; + } + + Collection>> collection = new Collection>>(); + Collection> parameters = new Collection>(); + System.Xml.XmlNodeList dataSources = XmlHelper.GetNodes(reportPath, "//DataSource"); + + foreach(System.Xml.XmlNode datasource in dataSources) + { + foreach(System.Xml.XmlNode parameterNodes in datasource.ChildNodes) + { + if(parameterNodes.Name.Equals("Parameters")) + { + foreach(System.Xml.XmlNode parameterNode in parameterNodes.ChildNodes) + { + parameters.Add(new KeyValuePair(parameterNode.Attributes["Name"].Value, GetParameterValue(parameterNode.Attributes["Name"].Value, parameterCollection))); + } + } + } + + collection.Add(parameters); + } + + return collection; + } + + private static string GetParameterValue(string key, Collection> collection) + { + if(string.IsNullOrWhiteSpace(key)) + { + return string.Empty; + } + + if(collection == null) + { + return string.Empty; + } + + foreach(KeyValuePair item in collection) + { + if(item.Key.Equals(key)) + { + return item.Value; + } + } + + return string.Empty; + } + + public static Collection> GetParameters(string reportPath) + { + if(!System.IO.File.Exists(reportPath)) + { + return null; + } + + Collection> parameterCollection = new Collection>(); + System.Xml.XmlNodeList dataSources = XmlHelper.GetNodes(reportPath, "//DataSource"); + + foreach(System.Xml.XmlNode datasource in dataSources) + { + foreach(System.Xml.XmlNode parameters in datasource.ChildNodes) + { + if(parameters.Name.Equals("Parameters")) + { + foreach(System.Xml.XmlNode parameter in parameters.ChildNodes) + { + if(!KeyExists(parameter.Attributes["Name"].Value, parameterCollection)) + { + parameterCollection.Add(new KeyValuePair(parameter.Attributes["Name"].Value, parameter.Attributes["Type"].Value)); + } + } + } + } + } + + return parameterCollection; + } + + private static bool KeyExists(string key, Collection> collection) + { + foreach(KeyValuePair item in collection) + { + if(item.Key.Equals(key)) + { + return true; + } + } + + return false; + } + } +} diff --git a/MixERP.Net.BusinessLayer/Helpers/SessionHelper.cs b/MixERP.Net.BusinessLayer/Helpers/SessionHelper.cs new file mode 100644 index 000000000..472e8cea0 --- /dev/null +++ b/MixERP.Net.BusinessLayer/Helpers/SessionHelper.cs @@ -0,0 +1,129 @@ +/******************************************************************************** +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.Web; + +namespace MixERP.Net.BusinessLayer.Helpers +{ + public static class SessionHelper + { + public static long LogOnId() + { + return MixERP.Net.Common.Conversion.TryCastLong(HttpContext.Current.Session["LogOnId"]); + } + + public static int UserId() + { + return MixERP.Net.Common.Conversion.TryCastInteger(HttpContext.Current.Session["UserId"]); + } + + public static string UserName() + { + return MixERP.Net.Common.Conversion.TryCastString(HttpContext.Current.Session["UserName"]); + } + + public static string Role() + { + return MixERP.Net.Common.Conversion.TryCastString(HttpContext.Current.Session["Role"]); + } + + public static bool IsAdmin() + { + return MixERP.Net.Common.Conversion.TryCastBoolean(HttpContext.Current.Session["IsAdmin"]); + } + + public static bool IsSystem() + { + return MixERP.Net.Common.Conversion.TryCastBoolean(HttpContext.Current.Session["IsSystem"]); + } + + public static int OfficeId() + { + return MixERP.Net.Common.Conversion.TryCastInteger(HttpContext.Current.Session["OfficeId"]); + } + + public static string Nickname() + { + return MixERP.Net.Common.Conversion.TryCastString(HttpContext.Current.Session["NickName"]); + } + + public static string OfficeName() + { + return MixERP.Net.Common.Conversion.TryCastString(HttpContext.Current.Session["OfficeName"]); + } + + public static DateTime RegistrationDate() + { + return MixERP.Net.Common.Conversion.TryCastDate(HttpContext.Current.Session["RegistrationDate"]); + } + + public static string RegistrationNumber() + { + return MixERP.Net.Common.Conversion.TryCastString(HttpContext.Current.Session["RegistrationNumber"]); + } + + public static string PanNumber() + { + return MixERP.Net.Common.Conversion.TryCastString(HttpContext.Current.Session["PanNumber"]); + } + + public static string Street() + { + return MixERP.Net.Common.Conversion.TryCastString(HttpContext.Current.Session["Street"]); + } + + public static string City() + { + return MixERP.Net.Common.Conversion.TryCastString(HttpContext.Current.Session["City"]); + } + + public static string State() + { + return MixERP.Net.Common.Conversion.TryCastString(HttpContext.Current.Session["State"]); + } + + public static string Country() + { + return MixERP.Net.Common.Conversion.TryCastString(HttpContext.Current.Session["Country"]); + } + + public static string ZipCode() + { + return MixERP.Net.Common.Conversion.TryCastString(HttpContext.Current.Session["ZipCode"]); + } + + public static string Phone() + { + return MixERP.Net.Common.Conversion.TryCastString(HttpContext.Current.Session["Phone"]); + } + + public static string Fax() + { + return MixERP.Net.Common.Conversion.TryCastString(HttpContext.Current.Session["Fax"]); + } + + public static string Email() + { + return MixERP.Net.Common.Conversion.TryCastString(HttpContext.Current.Session["Email"]); + } + + public static string Url() + { + return MixERP.Net.Common.Conversion.TryCastString(HttpContext.Current.Session["Url"]); + } + + public static CultureInfo Culture() + { + return MixERP.Net.Common.Helpers.LocalizationHelper.Culture(); + } + } +} diff --git a/MixERP.Net.BusinessLayer/Helpers/TableHelper.cs b/MixERP.Net.BusinessLayer/Helpers/TableHelper.cs new file mode 100644 index 000000000..33c70debe --- /dev/null +++ b/MixERP.Net.BusinessLayer/Helpers/TableHelper.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.Text; +using System.Data; +using System.Data.Common; + +namespace MixERP.Net.BusinessLayer.Helpers +{ + public static class TableHelper + { + public static DataTable GetTable(string schema, string tableName, string exclusion) + { + return MixERP.Net.DatabaseLayer.Helpers.TableHelper.GetTable(schema, tableName, exclusion); + } + } +} diff --git a/MixERP.Net.BusinessLayer/Helpers/XmlHelper.cs b/MixERP.Net.BusinessLayer/Helpers/XmlHelper.cs new file mode 100644 index 000000000..3069d946a --- /dev/null +++ b/MixERP.Net.BusinessLayer/Helpers/XmlHelper.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.Xml; + +namespace MixERP.Net.BusinessLayer.Helpers +{ + public static class XmlHelper + { + public static XmlNodeList GetNodes(string path, string name) + { + System.Xml.XmlDocument doc = new System.Xml.XmlDocument(); + doc.Load(path); + return doc.SelectNodes(name); + } + + public static string GetNodeText(string path, string name) + { + System.Xml.XmlDocument doc = new System.Xml.XmlDocument(); + doc.Load(path); + return doc.SelectSingleNode(name).InnerXml; + } + + } +} diff --git a/MixERP.Net.BusinessLayer/Mix Open Foundation.snk b/MixERP.Net.BusinessLayer/Mix Open Foundation.snk new file mode 100644 index 000000000..11572dc3d Binary files /dev/null and b/MixERP.Net.BusinessLayer/Mix Open Foundation.snk differ diff --git a/MixERP.Net.BusinessLayer/MixERP.Net.BusinessLayer.csproj b/MixERP.Net.BusinessLayer/MixERP.Net.BusinessLayer.csproj new file mode 100644 index 000000000..df5452e9e --- /dev/null +++ b/MixERP.Net.BusinessLayer/MixERP.Net.BusinessLayer.csproj @@ -0,0 +1,123 @@ + + + + Debug + AnyCPU + 8.0.30703 + 2.0 + {81DE04CF-7DE9-42FF-8339-D05E2586DCBA} + Library + Properties + MixERP.Net.BusinessLayer + MixERP.Net.BusinessLayer + v4.0 + 512 + + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + ..\MixERP.ruleset + false + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + false + + + true + + + Mix Open Foundation.snk + + + + + + + + + + + + + + + + ASPXCodeBehind + + + ASPXCodeBehind + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {D5A09C22-8F48-4FB2-A14D-C62C8C8FCEC0} + MixERP.Net.Common + + + {F1F6FB95-5D7E-4E4C-9CC4-AC58DBD8F09F} + MixERP.Net.DatabaseLayer + + + + + + + + + Dictionary.xml + + + + + \ No newline at end of file diff --git a/MixERP.Net.BusinessLayer/MixERP.net.BusinessLayer.csproj.user b/MixERP.Net.BusinessLayer/MixERP.net.BusinessLayer.csproj.user new file mode 100644 index 000000000..55f44b95f --- /dev/null +++ b/MixERP.Net.BusinessLayer/MixERP.net.BusinessLayer.csproj.user @@ -0,0 +1,6 @@ + + + + ShowAllFiles + + \ No newline at end of file diff --git a/MixERP.Net.BusinessLayer/MixERP.net.BusinessLayer.licenseheader b/MixERP.Net.BusinessLayer/MixERP.net.BusinessLayer.licenseheader new file mode 100644 index 000000000..5f3dc8d98 --- /dev/null +++ b/MixERP.Net.BusinessLayer/MixERP.net.BusinessLayer.licenseheader @@ -0,0 +1,27 @@ +extensions: designer.cs generated.cs +extensions: .cs .cpp .h +/******************************************************************************** +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/. +***********************************************************************************/ +extensions: .aspx .ascx +<%-- +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/. +--%> +extensions: .vb +'Sample license text. +extensions: .xml .config .xsd + \ No newline at end of file diff --git a/MixERP.Net.BusinessLayer/Office/CashRepositories.cs b/MixERP.Net.BusinessLayer/Office/CashRepositories.cs new file mode 100644 index 000000000..f41a2e13e --- /dev/null +++ b/MixERP.Net.BusinessLayer/Office/CashRepositories.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.Data; +using System.Linq; +using System.Text; + +namespace MixERP.Net.BusinessLayer.Office +{ + public static class CashRepositories + { + public static DataTable GetCashRepositories() + { + return MixERP.Net.DatabaseLayer.Office.CashRepositories.GetCashRepositories(); + } + + public static DataTable GetCashRepositories(int officeId) + { + //TODO: Bind this instance to a collection of entities. + return MixERP.Net.DatabaseLayer.Office.CashRepositories.GetCashRepositories(officeId); + } + + public static decimal GetBalance(int cashRepositoryId) + { + return MixERP.Net.DatabaseLayer.Office.CashRepositories.GetBalance(cashRepositoryId); + } + + public static string GetDisplayField() + { + string displayField = MixERP.Net.Common.Helpers.ConfigurationHelper.GetSectionKey("MixERPDbParameters", "CashRepositoryDisplayField"); + if(string.IsNullOrWhiteSpace(displayField)) + { + displayField = "cash_repository_name"; + } + + return displayField; + } + } +} diff --git a/MixERP.Net.BusinessLayer/Office/CostCenters.cs b/MixERP.Net.BusinessLayer/Office/CostCenters.cs new file mode 100644 index 000000000..7f883c56b --- /dev/null +++ b/MixERP.Net.BusinessLayer/Office/CostCenters.cs @@ -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/. +***********************************************************************************/ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace MixERP.Net.BusinessLayer.Office +{ + public static class CostCenters + { + public static string GetDisplayField() + { + string displayField = MixERP.Net.Common.Helpers.ConfigurationHelper.GetSectionKey("MixERPDbParameters", "CostCenterDisplayField"); + if(string.IsNullOrWhiteSpace(displayField)) + { + displayField = "cost_center_name"; + } + + return displayField; + } + } +} diff --git a/MixERP.Net.BusinessLayer/Office/Offices.cs b/MixERP.Net.BusinessLayer/Office/Offices.cs new file mode 100644 index 000000000..87c518359 --- /dev/null +++ b/MixERP.Net.BusinessLayer/Office/Offices.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.Data; +using System.Data.Common; +using System.Linq; +using System.Text; + +namespace MixERP.Net.BusinessLayer.Office +{ + public static class Offices + { + public static DataTable GetOffices() + { + return MixERP.Net.DatabaseLayer.Office.Offices.GetOffices(); + } + } +} diff --git a/MixERP.Net.BusinessLayer/Office/Stores.cs b/MixERP.Net.BusinessLayer/Office/Stores.cs new file mode 100644 index 000000000..dbbe11841 --- /dev/null +++ b/MixERP.Net.BusinessLayer/Office/Stores.cs @@ -0,0 +1,35 @@ +/******************************************************************************** +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.Office +{ + public static class Stores + { + public static bool IsSalesAllowed(int storeId) + { + return MixERP.Net.DatabaseLayer.Office.Stores.IsSalesAllowed(storeId); + } + + public static string GetDisplayField() + { + string displayField = MixERP.Net.Common.Helpers.ConfigurationHelper.GetSectionKey("MixERPDbParameters", "StoreDisplayField"); + + if(string.IsNullOrWhiteSpace(displayField)) + { + displayField = "store_name"; + } + + return displayField; + } + + } +} diff --git a/MixERP.Net.BusinessLayer/Properties/AssemblyInfo.cs b/MixERP.Net.BusinessLayer/Properties/AssemblyInfo.cs new file mode 100644 index 000000000..ee9383bdc --- /dev/null +++ b/MixERP.Net.BusinessLayer/Properties/AssemblyInfo.cs @@ -0,0 +1,44 @@ +/******************************************************************************** +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.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("MixERP.Net.BusinessLayer")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("MixERP.Net.BusinessLayer")] +[assembly: AssemblyCopyright("Copyright © 2013")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] +[assembly: CLSCompliant(true)] +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("a7bcc6ef-9337-45cd-b370-8656fc2b0ba1")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/MixERP.Net.BusinessLayer/Security/User.cs b/MixERP.Net.BusinessLayer/Security/User.cs new file mode 100644 index 000000000..e7ffccd6c --- /dev/null +++ b/MixERP.Net.BusinessLayer/Security/User.cs @@ -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/. +***********************************************************************************/ +using System; +using System.Collections.Generic; +using System.Data.Common; +using System.Linq; +using System.Text; +using System.Web; +using System.Web.Security; +using System.Data; + +namespace MixERP.Net.BusinessLayer.Security +{ + public static class User + { + public static void SetSession(System.Web.UI.Page page, string user) + { + if(page != null) + { + try + { + using(DataTable table = GetUserTable(user)) + { + if(table.Rows.Count.Equals(1)) + { + long LogOnId = MixERP.Net.Common.Conversion.TryCastLong(table.Rows[0]["login_id"]); + + if(LogOnId.Equals(0)) + { + MixERP.Net.BusinessLayer.BasePageClass.RequestLogOnPage(); + return; + } + + page.Session["LogOnId"] = LogOnId; + page.Session["UserId"] = table.Rows[0]["user_id"]; + page.Session["UserName"] = user; + page.Session["Role"] = table.Rows[0]["role"]; + page.Session["IsSystem"] = table.Rows[0]["is_system"]; + page.Session["IsAdmin"] = table.Rows[0]["is_admin"]; + page.Session["OfficeCode"] = table.Rows[0]["office_code"]; + page.Session["OfficeId"] = table.Rows[0]["office_id"]; + page.Session["NickName"] = table.Rows[0]["nick_name"]; + page.Session["OfficeName"] = table.Rows[0]["office_name"]; + page.Session["RegistrationDate"] = table.Rows[0]["registration_date"]; + page.Session["RegistrationNumber"] = table.Rows[0]["registration_number"]; + page.Session["PanNumber"] = table.Rows[0]["pan_number"]; + page.Session["Street"] = table.Rows[0]["street"]; + page.Session["City"] = table.Rows[0]["city"]; + page.Session["State"] = table.Rows[0]["state"]; + page.Session["Country"] = table.Rows[0]["country"]; + page.Session["ZipCode"] = table.Rows[0]["zip_code"]; + page.Session["Phone"] = table.Rows[0]["phone"]; + page.Session["Fax"] = table.Rows[0]["fax"]; + page.Session["Email"] = table.Rows[0]["email"]; + page.Session["Url"] = table.Rows[0]["url"]; + } + } + } + catch(DbException) + { + //Swallow the exception + } + } + } + + public static bool SignIn(int officeId, string userName, string password, bool remember, System.Web.UI.Page page) + { + if(page != null) + { + try + { + long LogOnId = MixERP.Net.DatabaseLayer.Security.User.SignIn(officeId, userName, MixERP.Net.Common.Conversion.HashSha512(password, userName), page.Request.UserAgent, "0", ""); + + if(LogOnId > 0) + { + SetSession(page, userName); + + FormsAuthenticationTicket ticket = new FormsAuthenticationTicket(1, userName, DateTime.Now, DateTime.Now.AddMinutes(30), remember, String.Empty, FormsAuthentication.FormsCookiePath); + string encryptedCookie = FormsAuthentication.Encrypt(ticket); + HttpCookie cookie = new HttpCookie(FormsAuthentication.FormsCookieName, encryptedCookie); + cookie.Expires = DateTime.Now.AddMinutes(30); + page.Response.Cookies.Add(cookie); + //FormsAuthentication.RedirectFromLoginPage(userName, false); + + System.Web.Security.FormsAuthentication.RedirectFromLoginPage(userName, true, "MixERP.Net"); + + + return true; + } + } + catch(DbException) + { + //Swallow the exception + } + } + + return false; + } + + public static DataTable GetUserTable(string userName) + { + return MixERP.Net.DatabaseLayer.Security.User.GetUserTable(userName); + } + + } +} diff --git a/MixERP.Net.BusinessLayer/Transactions/DirectPurchase.cs b/MixERP.Net.BusinessLayer/Transactions/DirectPurchase.cs new file mode 100644 index 000000000..fa48ddfcb --- /dev/null +++ b/MixERP.Net.BusinessLayer/Transactions/DirectPurchase.cs @@ -0,0 +1,63 @@ +/******************************************************************************** +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.Text; +using System.Web.UI.WebControls; + +namespace MixERP.Net.BusinessLayer.Transactions +{ + public static class DirectPurchase + { + public static long Add(DateTime valueDate, int storeId, bool isCredit, string partyCode, GridView grid, int cashRepositoryId, int costCenterId, string referenceNumber, string statementReference) + { + MixERP.Net.Common.Models.Transactions.StockMasterModel stockMaster = new MixERP.Net.Common.Models.Transactions.StockMasterModel(); + Collection details = new Collection(); + long transactionMasterId = 0; + + stockMaster.PartyCode = partyCode; + stockMaster.StoreId = storeId; + stockMaster.CashRepositoryId = cashRepositoryId; + stockMaster.IsCredit = isCredit; + + if(!string.IsNullOrWhiteSpace(statementReference)) + { + statementReference = statementReference.Replace(" ", " ").Trim(); + } + + if(grid != null) + { + if(grid.Rows.Count > 0) + { + foreach(GridViewRow row in grid.Rows) + { + MixERP.Net.Common.Models.Transactions.StockMasterDetailModel detail = new MixERP.Net.Common.Models.Transactions.StockMasterDetailModel(); + + detail.StoreId = storeId; + detail.ItemCode = row.Cells[0].Text; + detail.Quantity = MixERP.Net.Common.Conversion.TryCastInteger(row.Cells[2].Text); + detail.UnitName = row.Cells[3].Text; + detail.Price = MixERP.Net.Common.Conversion.TryCastDecimal(row.Cells[4].Text); + detail.Discount = MixERP.Net.Common.Conversion.TryCastDecimal(row.Cells[6].Text); + detail.TaxRate = MixERP.Net.Common.Conversion.TryCastDecimal(row.Cells[8].Text); + detail.Tax = MixERP.Net.Common.Conversion.TryCastDecimal(row.Cells[9].Text); + + details.Add(detail); + } + } + } + + + transactionMasterId = MixERP.Net.DatabaseLayer.Transactions.DirectPurchase.Add(valueDate, MixERP.Net.BusinessLayer.Helpers.SessionHelper.OfficeId(), MixERP.Net.BusinessLayer.Helpers.SessionHelper.UserId(), MixERP.Net.BusinessLayer.Helpers.SessionHelper.LogOnId(), costCenterId, referenceNumber, statementReference, stockMaster, details); + MixERP.Net.DatabaseLayer.Transactions.Verification.CallAutoVerification(transactionMasterId); + return transactionMasterId; + } + } +} diff --git a/MixERP.Net.BusinessLayer/Transactions/DirectSales.cs b/MixERP.Net.BusinessLayer/Transactions/DirectSales.cs new file mode 100644 index 000000000..7461189aa --- /dev/null +++ b/MixERP.Net.BusinessLayer/Transactions/DirectSales.cs @@ -0,0 +1,63 @@ +/******************************************************************************** +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.Text; +using System.Web.UI.WebControls; + +namespace MixERP.Net.BusinessLayer.Transactions +{ + public static class DirectSales + { + public static long Add(DateTime valueDate, int storeId, bool isCredit, string partyCode, int agentId, int priceTypeId, GridView grid, int shipperId, string shippingAddressCode, decimal shippingCharge, int cashRepositoryId, int costCenterId, string referenceNumber, string statementReference) + { + MixERP.Net.Common.Models.Transactions.StockMasterModel stockMaster = new MixERP.Net.Common.Models.Transactions.StockMasterModel(); + Collection details = new Collection(); + long transactionMasterId = 0; + + stockMaster.PartyCode = partyCode; + stockMaster.IsCredit = isCredit; + stockMaster.PriceTypeId = priceTypeId; + stockMaster.ShipperId = shipperId; + stockMaster.ShippingAddressCode = shippingAddressCode; + stockMaster.ShippingCharge = shippingCharge; + stockMaster.AgentId = agentId; + stockMaster.CashRepositoryId = cashRepositoryId; + stockMaster.StoreId = storeId; + + if(grid != null) + { + if(grid.Rows.Count > 0) + { + foreach(GridViewRow row in grid.Rows) + { + MixERP.Net.Common.Models.Transactions.StockMasterDetailModel detail = new MixERP.Net.Common.Models.Transactions.StockMasterDetailModel(); + + detail.StoreId = storeId; + detail.ItemCode = row.Cells[0].Text; + detail.Quantity = MixERP.Net.Common.Conversion.TryCastInteger(row.Cells[2].Text); + detail.UnitName = row.Cells[3].Text; + detail.Price = MixERP.Net.Common.Conversion.TryCastDecimal(row.Cells[4].Text); + detail.Discount = MixERP.Net.Common.Conversion.TryCastDecimal(row.Cells[6].Text); + detail.TaxRate = MixERP.Net.Common.Conversion.TryCastDecimal(row.Cells[8].Text); + detail.Tax = MixERP.Net.Common.Conversion.TryCastDecimal(row.Cells[9].Text); + + details.Add(detail); + } + } + } + + + transactionMasterId = MixERP.Net.DatabaseLayer.Transactions.DirectSales.Add(valueDate, MixERP.Net.BusinessLayer.Helpers.SessionHelper.OfficeId(), MixERP.Net.BusinessLayer.Helpers.SessionHelper.UserId(), MixERP.Net.BusinessLayer.Helpers.SessionHelper.LogOnId(), costCenterId, referenceNumber, statementReference, stockMaster, details); + MixERP.Net.DatabaseLayer.Transactions.Verification.CallAutoVerification(transactionMasterId); + return transactionMasterId; + } + } +} diff --git a/MixERP.Net.BusinessLayer/Transactions/NonGlStockTransaction.cs b/MixERP.Net.BusinessLayer/Transactions/NonGlStockTransaction.cs new file mode 100644 index 000000000..9873f49c6 --- /dev/null +++ b/MixERP.Net.BusinessLayer/Transactions/NonGlStockTransaction.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.Collections.ObjectModel; +using System.Linq; +using System.Text; +using System.Web.UI.WebControls; + +namespace MixERP.Net.BusinessLayer.Transactions +{ + public static class NonGLStockTransaction + { + public static long Add(string book, DateTime valueDate, string partyCode, int priceTypeId, GridView grid, string referenceNumber, string statementReference) + { + MixERP.Net.Common.Models.Transactions.StockMasterModel stockMaster = new MixERP.Net.Common.Models.Transactions.StockMasterModel(); + Collection details = new Collection(); + long nonGlStockMasterId = 0; + + stockMaster.PartyCode = partyCode; + stockMaster.PriceTypeId = priceTypeId; + + if(grid != null) + { + if(grid.Rows.Count > 0) + { + foreach(GridViewRow row in grid.Rows) + { + MixERP.Net.Common.Models.Transactions.StockMasterDetailModel detail = new MixERP.Net.Common.Models.Transactions.StockMasterDetailModel(); + + detail.ItemCode = row.Cells[0].Text; + detail.Quantity = MixERP.Net.Common.Conversion.TryCastInteger(row.Cells[2].Text); + detail.UnitName = row.Cells[3].Text; + detail.Price = MixERP.Net.Common.Conversion.TryCastDecimal(row.Cells[4].Text); + detail.Discount = MixERP.Net.Common.Conversion.TryCastDecimal(row.Cells[6].Text); + detail.TaxRate = MixERP.Net.Common.Conversion.TryCastDecimal(row.Cells[8].Text); + detail.Tax = MixERP.Net.Common.Conversion.TryCastDecimal(row.Cells[9].Text); + + details.Add(detail); + } + } + } + + nonGlStockMasterId = MixERP.Net.DatabaseLayer.Transactions.NonGLStockTransaction.Add(book, valueDate, MixERP.Net.BusinessLayer.Helpers.SessionHelper.OfficeId(), MixERP.Net.BusinessLayer.Helpers.SessionHelper.UserId(), MixERP.Net.BusinessLayer.Helpers.SessionHelper.LogOnId(), referenceNumber, statementReference, stockMaster, details); + return nonGlStockMasterId; + } + + public static System.Data.DataTable GetView(string book) + { + return MixERP.Net.DatabaseLayer.Transactions.NonGLStockTransaction.GetView(MixERP.Net.BusinessLayer.Helpers.SessionHelper.OfficeId(), book); + } + } +} diff --git a/MixERP.Net.BusinessLayer/Transactions/SalesDelivery.cs b/MixERP.Net.BusinessLayer/Transactions/SalesDelivery.cs new file mode 100644 index 000000000..906452d02 --- /dev/null +++ b/MixERP.Net.BusinessLayer/Transactions/SalesDelivery.cs @@ -0,0 +1,59 @@ +/******************************************************************************** +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.Text; +using System.Web.UI.WebControls; + +namespace MixERP.Net.BusinessLayer.Transactions +{ + public static class SalesDelivery + { + public static long Add(DateTime valueDate, int storeId, string partyCode, int priceTypeId, GridView grid, int shipperId, decimal shippingCharge, int costCenterId, string referenceNumber, string statementReference) + { + MixERP.Net.Common.Models.Transactions.StockMasterModel stockMaster = new MixERP.Net.Common.Models.Transactions.StockMasterModel(); + Collection details = new Collection(); + long transactionMasterId = 0; + + stockMaster.PartyCode = partyCode; + stockMaster.StoreId = storeId; + stockMaster.PriceTypeId = priceTypeId; + stockMaster.ShipperId = shipperId; + stockMaster.ShippingCharge = shippingCharge; + + if(grid != null) + { + if(grid.Rows.Count > 0) + { + foreach(GridViewRow row in grid.Rows) + { + MixERP.Net.Common.Models.Transactions.StockMasterDetailModel detail = new MixERP.Net.Common.Models.Transactions.StockMasterDetailModel(); + + detail.StoreId = storeId; + detail.ItemCode = row.Cells[0].Text; + detail.Quantity = MixERP.Net.Common.Conversion.TryCastInteger(row.Cells[2].Text); + detail.UnitName = row.Cells[3].Text; + detail.Price = MixERP.Net.Common.Conversion.TryCastDecimal(row.Cells[4].Text); + detail.Discount = MixERP.Net.Common.Conversion.TryCastDecimal(row.Cells[6].Text); + detail.TaxRate = MixERP.Net.Common.Conversion.TryCastDecimal(row.Cells[8].Text); + detail.Tax = MixERP.Net.Common.Conversion.TryCastDecimal(row.Cells[9].Text); + + details.Add(detail); + } + } + } + + + transactionMasterId = MixERP.Net.DatabaseLayer.Transactions.SalesDelivery.Add(valueDate, MixERP.Net.BusinessLayer.Helpers.SessionHelper.OfficeId(), MixERP.Net.BusinessLayer.Helpers.SessionHelper.UserId(), MixERP.Net.BusinessLayer.Helpers.SessionHelper.LogOnId(), costCenterId, referenceNumber, statementReference, stockMaster, details); + MixERP.Net.DatabaseLayer.Transactions.Verification.CallAutoVerification(transactionMasterId); + return transactionMasterId; + } + } +} diff --git a/MixERP.Net.BusinessLayer/Transactions/Transaction.cs b/MixERP.Net.BusinessLayer/Transactions/Transaction.cs new file mode 100644 index 000000000..4e85ff3bb --- /dev/null +++ b/MixERP.Net.BusinessLayer/Transactions/Transaction.cs @@ -0,0 +1,48 @@ +/******************************************************************************** +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.Text; +using System.Web.UI.WebControls; + +namespace MixERP.Net.BusinessLayer.Transactions +{ + public static class Transaction + { + public static long Add(DateTime valueDate, string referenceNumber, int costCenterId, GridView grid) + { + Collection details = new Collection(); + long transactionMasterId = 0; + + if(grid != null) + { + if(grid.Rows.Count > 0) + { + foreach(GridViewRow row in grid.Rows) + { + MixERP.Net.Common.Models.Transactions.TransactionDetailModel detail = new MixERP.Net.Common.Models.Transactions.TransactionDetailModel(); + detail.AccountCode = row.Cells[0].Text; + detail.CashRepositoryName = row.Cells[2].Text; + detail.StatementReference = row.Cells[3].Text.Replace(" ", " ").Trim(); + detail.Debit = MixERP.Net.Common.Conversion.TryCastDecimal(row.Cells[4].Text); + detail.Credit = MixERP.Net.Common.Conversion.TryCastDecimal(row.Cells[5].Text); + + details.Add(detail); + } + } + } + + + transactionMasterId = MixERP.Net.DatabaseLayer.Transactions.Transaction.Add(valueDate, MixERP.Net.BusinessLayer.Helpers.SessionHelper.OfficeId(), MixERP.Net.BusinessLayer.Helpers.SessionHelper.UserId(), MixERP.Net.BusinessLayer.Helpers.SessionHelper.LogOnId(), costCenterId, referenceNumber, details); + MixERP.Net.DatabaseLayer.Transactions.Verification.CallAutoVerification(transactionMasterId); + return transactionMasterId; + } + } +} diff --git a/MixERP.Net.BusinessLayer/Transactions/Verification.cs b/MixERP.Net.BusinessLayer/Transactions/Verification.cs new file mode 100644 index 000000000..0db900f17 --- /dev/null +++ b/MixERP.Net.BusinessLayer/Transactions/Verification.cs @@ -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/. +***********************************************************************************/ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace MixERP.Net.BusinessLayer.Transactions +{ + public static class Verification + { + public static MixERP.Net.Common.Models.Transactions.VerificationModel GetVerificationStatus(long transactionMasterId) + { + return MixERP.Net.DatabaseLayer.Transactions.Verification.GetVerificationStatus(transactionMasterId); + } + + public static bool WithdrawTransaction(long transactionMasterId, int userId, string reason) + { + return MixERP.Net.DatabaseLayer.Transactions.Verification.WithdrawTransaction(transactionMasterId, userId, reason); + } + } +} diff --git a/MixERP.Net.Common/Conversion.cs b/MixERP.Net.Common/Conversion.cs new file mode 100644 index 000000000..19b7b3b8f --- /dev/null +++ b/MixERP.Net.Common/Conversion.cs @@ -0,0 +1,408 @@ +/******************************************************************************** +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/. +***********************************************************************************/ +namespace MixERP.Net.Common +{ + using System; + using System.Collections.Generic; + using System.Configuration; + using System.Data; + using System.Drawing; + using System.Globalization; + using System.Linq; + using System.Text; + using System.Security.Cryptography; + using System.Text.RegularExpressions; + using System.Web; + + public static class Conversion + { + + public static string MapPathReverse(string fullServerPath) + { + if(fullServerPath == null) + { + return null; + } + + return @"~\" + fullServerPath.Replace(HttpContext.Current.Request.PhysicalApplicationPath, String.Empty); + } + + public static short TryCastShort(object value) + { + if(value != null) + { + short retVal = 0; + //string numberToParse = RemoveGroupping(value.ToString()); + string numberToParse = value.ToString(); + + if(short.TryParse(numberToParse, out retVal)) + { + return retVal; + } + } + + return 0; + } + + public static long TryCastLong(object value) + { + if(value != null) + { + long retVal = 0; + //string numberToParse = RemoveGroupping(value.ToString()); + string numberToParse = value.ToString(); + + if(long.TryParse(numberToParse, out retVal)) + { + return retVal; + } + } + + return 0; + } + + public static float TryCastSingle(object value) + { + if(value != null) + { + float retVal = 0; + //string numberToParse = RemoveGroupping(value.ToString()); + string numberToParse = value.ToString(); + + if(float.TryParse(numberToParse, out retVal)) + { + return retVal; + } + } + + return 0; + } + + public static double TryCastDouble(object value) + { + if(value != null) + { + double retVal = 0; + //string numberToParse = RemoveGroupping(value.ToString()); + string numberToParse = value.ToString(); + + if(double.TryParse(numberToParse, out retVal)) + { + return retVal; + } + } + + return 0; + } + + public static int TryCastInteger(object value) + { + if(value != null) + { + if(value is bool) + { + if(Convert.ToBoolean(value, CultureInfo.InvariantCulture)) + { + return 1; + } + else + { + return 0; + } + } + + int retVal = 0; + //string numberToParse = RemoveGroupping(value.ToString()); + string numberToParse = value.ToString(); + + if(int.TryParse(numberToParse, out retVal)) + { + return retVal; + } + } + + return 0; + } + + public static DateTime TryCastDate(object value) + { + try + { + if(value == DBNull.Value) + { + return DateTime.MinValue; + } + + return Convert.ToDateTime(value, System.Threading.Thread.CurrentThread.CurrentCulture); + } + catch(FormatException) + { + //swallow the exception + } + catch(InvalidCastException) + { + //swallow the exception + } + + return DateTime.MinValue; + } + + //private static string RemoveGroupping(string number) + //{ + // string thousandSeparator = Helpers.Parameters.ThousandSeparator(); + // string decimalSeparator = Helpers.Parameters.DecimalSeparator(); + + // //Remove the thousand separator from the number + // number = number.Replace(thousandSeparator, ""); + + // //Replace the decimal separator with "dot". + // if(!decimalSeparator.Equals(".")) + // { + // number = number.Replace(decimalSeparator, "."); + // } + + // return number; + //} + + public static decimal TryCastDecimal(object value) + { + if(value != null) + { + decimal retVal = 0; + //string numberToParse = RemoveGroupping(value.ToString()); + string numberToParse = value.ToString(); + + if(decimal.TryParse(numberToParse, out retVal)) + { + return retVal; + } + } + + return 0; + } + + public static bool TryCastBoolean(object value) + { + if(value != null) + { + if(value is string) + { + if(value.ToString().ToLower(System.Threading.Thread.CurrentThread.CurrentCulture).Equals("yes")) + { + return true; + } + + if(value.ToString().ToLower(System.Threading.Thread.CurrentThread.CurrentCulture).Equals("true")) + { + return true; + } + } + + bool retVal = false; + if(bool.TryParse(value.ToString(), out retVal)) + { + return retVal; + } + } + + return false; + } + + public static string TryCastString(object value) + { + try + { + if(value != null) + { + if(value is bool) + { + if(Convert.ToBoolean(value, CultureInfo.InvariantCulture) == true) + { + return "true"; + } + else + { + return "false"; + } + } + else + { + if(value == System.DBNull.Value) + { + return string.Empty; + } + else + { + string retVal = value.ToString(); + return retVal; + } + } + } + else + { + return string.Empty; + } + } + catch(FormatException) + { + //swallow the exception + } + catch(InvalidCastException) + { + //swallow the exception + } + + return string.Empty; + } + + public static string HashSha512(string password, string salt) + { + if(password == null) + { + return null; + } + + if(salt == null) + { + return null; + } + + byte[] bytes = Encoding.Unicode.GetBytes(password + salt); + using(SHA512CryptoServiceProvider hash = new SHA512CryptoServiceProvider()) + { + byte[] inArray = hash.ComputeHash(bytes); + return Convert.ToBase64String(inArray); + } + } + + + public static Uri GetBackEndUrl(System.Web.HttpContext context, string relativePath) + { + string lang = string.Empty; + string administrationDirectoryName = System.Web.Configuration.WebConfigurationManager.AppSettings["AdministrationDirectoryName"]; + + if(context != null) + { + if(!string.IsNullOrWhiteSpace(administrationDirectoryName)) + { + if((context.Session == null) || (context.Session["lang"] == null || string.IsNullOrWhiteSpace(context.Session["lang"] as string))) + { + lang = "en-US"; + } + else + { + lang = context.Session["lang"] as string; + } + + System.Globalization.CultureInfo culture = new System.Globalization.CultureInfo(lang); + if(culture.TwoLetterISOLanguageName == "iv") + { + culture = new System.Globalization.CultureInfo("en-US"); + } + + string virtualDirectory = context.Request.ApplicationPath; + bool isSecure = context.Request.IsSecureConnection; + string domain = context.Request.Url.DnsSafeHost; + int port = context.Request.Url.Port; + string path = string.Empty; + + if(virtualDirectory == "/") + { + path = string.Format(CultureInfo.InvariantCulture, "{0}:{1}/{2}/{3}/{4}/", domain, port.ToString(CultureInfo.InvariantCulture), administrationDirectoryName, culture.TwoLetterISOLanguageName, relativePath); + } + else + { + path = string.Format(CultureInfo.InvariantCulture, "{0}:{1}{2}/{3}/{4}/{5}/", domain, port.ToString(CultureInfo.InvariantCulture), virtualDirectory, administrationDirectoryName, culture.TwoLetterISOLanguageName, relativePath); + } + + if(isSecure) + { + path = "https://" + path; + } + else + { + path = "http://" + path; + } + + return new Uri(path, UriKind.Absolute); + } + } + return new Uri("", UriKind.Relative); + } + + public static DateTime GetLocalDateTime(string timeZone, DateTime utc) + { + TimeZoneInfo zone = TimeZoneInfo.FindSystemTimeZoneById(timeZone); + return TimeZoneInfo.ConvertTimeFromUtc(utc, zone); + } + + public static string GetLocalDateTimeString(string timeZone, DateTime utc) + { + TimeZoneInfo zone = TimeZoneInfo.FindSystemTimeZoneById(timeZone); + DateTime time = TimeZoneInfo.ConvertTimeFromUtc(utc, zone); + return time.ToLongDateString() + " " + time.ToLongTimeString() + " " + zone.DisplayName; + } + + public static byte[] TryCastByteArray(Bitmap bitmap) + { + ImageConverter converter = new ImageConverter(); + return (byte[])converter.ConvertTo(bitmap, typeof(byte[])); + } + + public static byte[] TryCastByteArray(Image image) + { + ImageConverter converter = new ImageConverter(); + return (byte[])converter.ConvertTo(image, typeof(byte[])); + } + + public static System.Data.DataTable ConvertListToDataTable(System.Collections.Generic.IList list) + { + if(list == null) + { + return null; + } + + System.ComponentModel.PropertyDescriptorCollection props = System.ComponentModel.TypeDescriptor.GetProperties(typeof(T)); + + using(System.Data.DataTable table = new System.Data.DataTable()) + { + table.Locale = System.Threading.Thread.CurrentThread.CurrentCulture; + + for(int i = 0; i < props.Count; i++) + { + System.ComponentModel.PropertyDescriptor prop = props[i]; + table.Columns.Add(prop.Name, prop.PropertyType); + } + object[] values = new object[props.Count]; + foreach(T item in list) + { + for(int i = 0; i < values.Length; i++) + { + values[i] = props[i].GetValue(item); + } + table.Rows.Add(values); + } + return table; + } + } + + public static byte[] ConvertImageToByteArray(System.Drawing.Image imageToConvert, System.Drawing.Imaging.ImageFormat formatOfImage) + { + if(imageToConvert == null) + { + return null; + } + + using(System.IO.MemoryStream ms = new System.IO.MemoryStream()) + { + imageToConvert.Save(ms, formatOfImage); + return ms.ToArray(); + } + } + } +} diff --git a/MixERP.Net.Common/ExceptionManager.cs b/MixERP.Net.Common/ExceptionManager.cs new file mode 100644 index 000000000..5d2b94b31 --- /dev/null +++ b/MixERP.Net.Common/ExceptionManager.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.Linq; +using System.Text; +using System.Web; + +namespace MixERP.Net.Common +{ + public static class ExceptionManager + { + public static void HandleException(Exception ex) + { + if(ex == null) + { + return; + } + + var exception = ex; + + if(ex.GetBaseException() != null) + { + exception = ex.GetBaseException(); + } + + System.Web.HttpContext.Current.Session["ex"] = exception; + System.Web.HttpContext.Current.Response.Redirect("~/RuntimeError.aspx", true); + } + } +} diff --git a/MixERP.Net.Common/Helpers/ConfigurationHelper.cs b/MixERP.Net.Common/Helpers/ConfigurationHelper.cs new file mode 100644 index 000000000..fc605ad12 --- /dev/null +++ b/MixERP.Net.Common/Helpers/ConfigurationHelper.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.Collections.Specialized; +using System.Linq; +using System.Text; + +namespace MixERP.Net.Common.Helpers +{ + public static class ConfigurationHelper + { + public static string GetSectionKey(string sectionName, string keyName) + { + NameValueCollection parameters = (NameValueCollection)System.Configuration.ConfigurationManager.GetSection(sectionName); + if(parameters != null) + { + return parameters[keyName]; + } + + return string.Empty; + } + } +} diff --git a/MixERP.Net.Common/Helpers/ExpressionHelper.cs b/MixERP.Net.Common/Helpers/ExpressionHelper.cs new file mode 100644 index 000000000..63ebda0a3 --- /dev/null +++ b/MixERP.Net.Common/Helpers/ExpressionHelper.cs @@ -0,0 +1,75 @@ +/******************************************************************************** +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 Microsoft.CSharp; +using System.CodeDom.Compiler; +using System.Reflection; + +namespace MixERP.Net.Common.Helpers +{ + public static class ExpressionHelper + { + public static string Eval(string expression) + { + using(CSharpCodeProvider provider = new CSharpCodeProvider()) + { + CompilerParameters parameters = new CompilerParameters(); + + parameters.ReferencedAssemblies.Add("system.dll"); + parameters.ReferencedAssemblies.Add("system.xml.dll"); + parameters.ReferencedAssemblies.Add("system.data.dll"); + parameters.ReferencedAssemblies.Add("system.windows.forms.dll"); + parameters.ReferencedAssemblies.Add("system.drawing.dll"); + + parameters.CompilerOptions = "/t:library"; + parameters.GenerateInMemory = true; + + StringBuilder sourceBuilder = new StringBuilder(""); + sourceBuilder.Append("using System;\n"); + sourceBuilder.Append("using System.Xml;\n"); + sourceBuilder.Append("using System.Data;\n"); + sourceBuilder.Append("using System.Data.SqlClient;\n"); + sourceBuilder.Append("using System.Windows.Forms;\n"); + sourceBuilder.Append("using System.Drawing;\n"); + + sourceBuilder.Append("namespace CSCodeEvaler{ \n"); + sourceBuilder.Append("public class CSCodeEvaler{ \n"); + sourceBuilder.Append("public object EvalCode(){\n"); + sourceBuilder.Append("return " + expression + "; \n"); + sourceBuilder.Append("} \n"); + sourceBuilder.Append("} \n"); + sourceBuilder.Append("}\n"); + + try + { + CompilerResults results = provider.CompileAssemblyFromSource(parameters, sourceBuilder.ToString()); + if(results.Errors.Count > 0) + { + return string.Empty; + } + + System.Reflection.Assembly assembly = results.CompiledAssembly; + object assemblyInstance = assembly.CreateInstance("CSCodeEvaler.CSCodeEvaler"); + + Type assemblyInstanceType = assemblyInstance.GetType(); + MethodInfo info = assemblyInstanceType.GetMethod("EvalCode"); + + object output = info.Invoke(assemblyInstance, null); + return output.ToString(); + } + catch(NotImplementedException) + { + return string.Empty; + } + } + } + } +} \ No newline at end of file diff --git a/MixERP.Net.Common/Helpers/LocalizationHelper.cs b/MixERP.Net.Common/Helpers/LocalizationHelper.cs new file mode 100644 index 000000000..f529cd931 --- /dev/null +++ b/MixERP.Net.Common/Helpers/LocalizationHelper.cs @@ -0,0 +1,64 @@ +/******************************************************************************** +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; + +namespace MixERP.Net.Common.Helpers +{ + public static class LocalizationHelper + { + public static string GetResourceString(string className, string key) + { + if(string.IsNullOrWhiteSpace(key) || System.Web.HttpContext.Current == null) + { + return string.Empty; + } + try + { + return System.Web.HttpContext.GetGlobalResourceObject(className, key, Culture()).ToString(); + } + catch + { + throw new InvalidOperationException("Resource could not be found for the key " + key + " on class " + className + " ."); + } + } + + public static string GetResourceString(string className, string key, bool throwError) + { + if(string.IsNullOrWhiteSpace(key) || System.Web.HttpContext.Current == null) + { + return string.Empty; + } + try + { + return System.Web.HttpContext.GetGlobalResourceObject(className, key, Culture()).ToString(); + } + catch + { + if(throwError) + { + throw new InvalidOperationException("Resource could not be found for the key " + key + " on class " + className + " ."); + } + } + + return key; + } + + + public static CultureInfo Culture() + { + //Todo + CultureInfo culture = new CultureInfo(CultureInfo.InvariantCulture.Name); + return culture; + } + + } +} diff --git a/MixERP.Net.Common/Helpers/Parameters.cs b/MixERP.Net.Common/Helpers/Parameters.cs new file mode 100644 index 000000000..9b73bbb3b --- /dev/null +++ b/MixERP.Net.Common/Helpers/Parameters.cs @@ -0,0 +1,67 @@ +/******************************************************************************** +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.Common.Helpers +{ + public static class Parameters + { + public static string PartyName() + { + return GetParameter("PartyName"); + } + + private static string GetParameter(string key) + { + return MixERP.Net.Common.Helpers.ConfigurationHelper.GetSectionKey("MixERPParameters", key); + } + + public static string ShortDateFormat() + { + return GetParameter("ShortDateFormat"); + } + + public static string LongDateFormat() + { + return GetParameter("LongDateFormat"); + } + + public static string ShortTimeFormat() + { + return GetParameter("ShortTimeFormat"); + } + + public static string LongTimeFormat() + { + return GetParameter("LongTimeFormat"); + } + + public static string ThousandSeparator() + { + return GetParameter("ThousandSeparator"); + } + + public static string DecimalSeparator() + { + return GetParameter("DecimalSeparator"); + } + + public static string DecimalPlaces() + { + return GetParameter("DecimalPlaces"); + } + + public static string CurrencySymbol() + { + return GetParameter("CurrencySymbol"); + } + } +} diff --git a/MixERP.Net.Common/Helpers/Switches.cs b/MixERP.Net.Common/Helpers/Switches.cs new file mode 100644 index 000000000..6c6272cdf --- /dev/null +++ b/MixERP.Net.Common/Helpers/Switches.cs @@ -0,0 +1,54 @@ +/******************************************************************************** +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.Common.Helpers +{ + public static class Switches + { + public static bool AllowNonSupplierInPurchase() + { + return GetSwitch("AllowNonSupplierInPurchase"); + } + + public static bool AllowSupplierInSales() + { + return GetSwitch("AllowSupplierInSales"); + } + + public static bool AllowParentAccountInGLTransaction() + { + return GetSwitch("AllowParentAccountInGLTransaction"); + } + + public static bool EnableAutoVerification() + { + return GetSwitch("EnableAutoVerification"); + } + + public static bool TaxAfterDiscount() + { + return GetSwitch("TaxAfterDiscount"); + } + + private static bool GetSwitch(string key) + { + string sw = MixERP.Net.Common.Helpers.ConfigurationHelper.GetSectionKey("MixERPSwitches", key); + if(string.IsNullOrWhiteSpace(sw)) + { + return false; + } + + return sw.Equals("true"); + } + + } +} diff --git a/MixERP.Net.Common/Mix Open Foundation.snk b/MixERP.Net.Common/Mix Open Foundation.snk new file mode 100644 index 000000000..11572dc3d Binary files /dev/null and b/MixERP.Net.Common/Mix Open Foundation.snk differ diff --git a/MixERP.Net.Common/MixERP.Net.Common.csproj b/MixERP.Net.Common/MixERP.Net.Common.csproj new file mode 100644 index 000000000..4fdaf3026 --- /dev/null +++ b/MixERP.Net.Common/MixERP.Net.Common.csproj @@ -0,0 +1,95 @@ + + + + Debug + AnyCPU + 8.0.30703 + 2.0 + {D5A09C22-8F48-4FB2-A14D-C62C8C8FCEC0} + Library + Properties + MixERP.Net.Common + MixERP.Net.Common + v4.0 + 512 + + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + ..\MixERP.ruleset + false + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + false + + + true + + + Mix Open Foundation.snk + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Dictionary.xml + + + + + \ No newline at end of file diff --git a/MixERP.Net.Common/MixERP.net.Common.licenseheader b/MixERP.Net.Common/MixERP.net.Common.licenseheader new file mode 100644 index 000000000..5f3dc8d98 --- /dev/null +++ b/MixERP.Net.Common/MixERP.net.Common.licenseheader @@ -0,0 +1,27 @@ +extensions: designer.cs generated.cs +extensions: .cs .cpp .h +/******************************************************************************** +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/. +***********************************************************************************/ +extensions: .aspx .ascx +<%-- +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/. +--%> +extensions: .vb +'Sample license text. +extensions: .xml .config .xsd + \ No newline at end of file diff --git a/MixERP.Net.Common/Models/Core/Menus.cs b/MixERP.Net.Common/Models/Core/Menus.cs new file mode 100644 index 000000000..5dae805d8 --- /dev/null +++ b/MixERP.Net.Common/Models/Core/Menus.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.Text; + +namespace MixERP.Net.Common.Models.Core +{ + public class Menu + { + public int MenuId { get; set; } + public string MenuText { get; set; } + public string Url { get; set; } + public string MenuCode { get; set; } + public int Level { get; set; } + public int ParentMenuId { get; set; } + } +} diff --git a/MixERP.Net.Common/Models/Transactions/JournalDetailsModel.cs b/MixERP.Net.Common/Models/Transactions/JournalDetailsModel.cs new file mode 100644 index 000000000..d8fffc976 --- /dev/null +++ b/MixERP.Net.Common/Models/Transactions/JournalDetailsModel.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.Text; + +namespace MixERP.Net.Common.Models.Transactions +{ + public class JournalDetailsModel + { + public string AccountCode { get; set; } + public string Account { get; set; } + public string CashRepository { get; set; } + public string StatementReference { get; set; } + public decimal Debit { get; set; } + public decimal Credit { get; set; } + } +} diff --git a/MixERP.Net.Common/Models/Transactions/ProductDetailsModel.cs b/MixERP.Net.Common/Models/Transactions/ProductDetailsModel.cs new file mode 100644 index 000000000..ccda41bda --- /dev/null +++ b/MixERP.Net.Common/Models/Transactions/ProductDetailsModel.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.Common.Models.Transactions +{ + public class ProductDetailsModel + { + public string ItemCode { get; set; } + public string ItemName { get; set; } + public int Quantity { get; set; } + public string Unit { get; set; } + public decimal Price { get; set; } + public decimal Amount { get; set; } + public decimal Discount { get; set; } + public decimal Subtotal { get; set; } + public decimal Rate { get; set; } + public decimal Tax { get; set; } + public decimal Total { get; set; } + } +} diff --git a/MixERP.Net.Common/Models/Transactions/StockMasterDetailModel.cs b/MixERP.Net.Common/Models/Transactions/StockMasterDetailModel.cs new file mode 100644 index 000000000..b2a3e7c72 --- /dev/null +++ b/MixERP.Net.Common/Models/Transactions/StockMasterDetailModel.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.Common.Models.Transactions +{ + public class StockMasterDetailModel + { + public long StockMasterDetailId { get; set; } + public long StockMasterId { get; set; } + public TransactionType TransactionType { get; set; } + public int StoreId { get; set; } + public string ItemCode { get; set; } + public int Quantity { get; set; } + public string UnitName { get; set; } + public decimal Price { get; set; } + public decimal Discount { get; set; } + public decimal TaxRate { get; set; } + public decimal Tax { get; set; } + } +} diff --git a/MixERP.Net.Common/Models/Transactions/StockMasterModel.cs b/MixERP.Net.Common/Models/Transactions/StockMasterModel.cs new file mode 100644 index 000000000..9a0942068 --- /dev/null +++ b/MixERP.Net.Common/Models/Transactions/StockMasterModel.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.Common.Models.Transactions +{ + public class StockMasterModel + { + public long StockMasterId { get; set; } + public long TransactionMasterId { get; set; } + public string PartyCode { get; set; } + public int AgentId { get; set; } + public int PriceTypeId { get; set; } + public bool IsCredit { get; set; } + public int ShipperId { get; set; } + public string ShippingAddressCode { get; set; } + public decimal ShippingCharge { get; set; } + public int StoreId { get; set; } + public int CashRepositoryId { get; set; } + } +} diff --git a/MixERP.Net.Common/Models/Transactions/TranactionMasterModel.cs b/MixERP.Net.Common/Models/Transactions/TranactionMasterModel.cs new file mode 100644 index 000000000..2e8c356ab --- /dev/null +++ b/MixERP.Net.Common/Models/Transactions/TranactionMasterModel.cs @@ -0,0 +1,31 @@ +/******************************************************************************** +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.Common.Models.Transactions +{ + public class TransactionMasterModel + { + public long TransactionMasterId { get; set; } + public int TransactionCounter { get; set; } + public string TransactionCode { get; set; } + public string Book { get; set; } + public DateTime ValueDate { get; set; } + public DateTime TransactionTimestamp { get; set; } + public long LogOnId { get; set; } + public int SysUserId { get; set; } + public int OfficeId { get; set; } + public int CostCenterId { get; set; } + public string ReferenceNumber { get; set; } + public string StatementReference { get; set; } + public VerificationType Verification { get; set; } + } +} diff --git a/MixERP.Net.Common/Models/Transactions/TransactionDetailModel.cs b/MixERP.Net.Common/Models/Transactions/TransactionDetailModel.cs new file mode 100644 index 000000000..f81d2f764 --- /dev/null +++ b/MixERP.Net.Common/Models/Transactions/TransactionDetailModel.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.Text; + +namespace MixERP.Net.Common.Models.Transactions +{ + public class TransactionDetailModel + { + public long TransactionDetailId { get; set; } + public long TransactionMasterId { get; set; } + public string AccountCode { get; set; } + public string CashRepositoryName { get; set; } + public string StatementReference { get; set; } + public decimal Debit { get; set; } + public decimal Credit { get; set; } + } +} diff --git a/MixERP.Net.Common/Models/Transactions/TransactionTypeDomain.cs b/MixERP.Net.Common/Models/Transactions/TransactionTypeDomain.cs new file mode 100644 index 000000000..ba8197302 --- /dev/null +++ b/MixERP.Net.Common/Models/Transactions/TransactionTypeDomain.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.Common.Models.Transactions +{ + public enum TransactionType { Debit, Credit } + + public static class TransactionTypeDomain + { + public static string GetDomain(TransactionType type) + { + if(type == TransactionType.Debit) + return "Dr"; + else if(type == TransactionType.Credit) + return "Cr"; + else + throw new InvalidOperationException(MixERP.Net.Common.Helpers.LocalizationHelper.GetResourceString("Warnings", "UnknownTransactionType")); + } + + } +} diff --git a/MixERP.Net.Common/Models/Transactions/VerificationDomain.cs b/MixERP.Net.Common/Models/Transactions/VerificationDomain.cs new file mode 100644 index 000000000..9d4333a39 --- /dev/null +++ b/MixERP.Net.Common/Models/Transactions/VerificationDomain.cs @@ -0,0 +1,38 @@ +/******************************************************************************** +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.Common.Models.Transactions +{ + public enum VerificationType { Rejected, Closed, Withdrawn, Unapproved, Approved } + + public static class VerificationDomain + { + public static short GetVerification(VerificationType type) + { + switch(type) + { + case VerificationType.Rejected: + return -3; + case VerificationType.Closed: + return -2; + case VerificationType.Withdrawn: + return -1; + case VerificationType.Unapproved: + return 0; + case VerificationType.Approved: + return 1; + } + + return 0; + } + } +} diff --git a/MixERP.Net.Common/Models/Transactions/VerificationModel.cs b/MixERP.Net.Common/Models/Transactions/VerificationModel.cs new file mode 100644 index 000000000..168341342 --- /dev/null +++ b/MixERP.Net.Common/Models/Transactions/VerificationModel.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.Text; + +namespace MixERP.Net.Common.Models.Transactions +{ + public class VerificationModel + { + public short Verification { get; set; } + public int VerifierUserId { get; set; } + public string VerifierName { get; set; } + public DateTime VerifiedDate { get; set; } + public string VerificationReason { get; set; } + } +} diff --git a/MixERP.Net.Common/PageUtility.cs b/MixERP.Net.Common/PageUtility.cs new file mode 100644 index 000000000..0d8442102 --- /dev/null +++ b/MixERP.Net.Common/PageUtility.cs @@ -0,0 +1,200 @@ +/******************************************************************************** +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.Globalization; +using System.Net; + +namespace MixERP.Net.Common +{ + public static class PageUtility + { + public static void RefreshPage(System.Web.UI.Page page) + { + if(page != null) + { + page.Response.Redirect(page.Request.Url.AbsolutePath); + } + } + + public static string GetUserIPAddress() + { + Page page = HttpContext.Current.Handler as Page; + string ip = page.Request.ServerVariables["HTTP_X_FORWARDED_FOR"]; + if(!string.IsNullOrEmpty(ip)) + { + string[] ipRange = ip.Split(','); + ip = ipRange[0]; + } + else + { + ip = page.Request.ServerVariables["REMOTE_ADDR"]; + } + return ip.Trim(); + } + + public static void ExecuteJavaScript(string key, string javaScript, Page page) + { + ScriptManager.RegisterStartupScript(page, typeof(System.Web.UI.Page), key, javaScript, true); + } + + public static string ResolveUrl(string relativeUrl) + { + if(HttpContext.Current != null) + { + System.Web.UI.Page p = HttpContext.Current.Handler as System.Web.UI.Page; + if(p != null) + { + return p.ResolveUrl(relativeUrl); + } + } + return relativeUrl; + } + + public static bool IsLocalUrl(Uri url, System.Web.UI.Page page) + { + if(page == null) + { + return false; + } + + try + { + Uri requested = new Uri(page.Request.Url, url); + + if(requested.Host == page.Request.Url.Host) + { + return true; + } + } + catch(InvalidOperationException) + { + // + } + + return false; + } + + public static int InvalidPasswordAttempts(System.Web.UI.Page page, int increment) + { + if(page == null) + { + return 0; + } + + int retVal = 0; + if(page.Session["InvalidPasswordAttempts"] == null) + { + retVal = retVal + increment; + page.Session.Add("InvalidPasswordAttempts", retVal); + } + else + { + retVal = MixERP.Net.Common.Conversion.TryCastInteger(page.Session["InvalidPasswordAttempts"]) + increment; + page.Session["InvalidPasswordAttempts"] = retVal; + } + + return retVal; + } + + public static void CheckInvalidAttempts(System.Web.UI.Page page) + { + if(page != null) + { + if(MixERP.Net.Common.PageUtility.InvalidPasswordAttempts(page, 0) >= MixERP.Net.Common.Conversion.TryCastInteger(System.Configuration.ConfigurationManager.AppSettings["MaxInvalidPasswordAttempts"])) + { + page.Response.Redirect("~/access-denied"); + } + } + } + + public static string GetCurrentDomainName() + { + string url = System.Web.HttpContext.Current.Request.Url.Scheme + "://" + System.Web.HttpContext.Current.Request.Url.Host; + + if(System.Web.HttpContext.Current.Request.Url.Port != 80) + { + url += ":" + System.Web.HttpContext.Current.Request.Url.Port.ToString(CultureInfo.InvariantCulture); + } + + return url; + } + + public static Control FindControlIterative(Control root, string id) + { + if(root == null) + { + return null; + } + + if(root.ID == id) return root; + foreach(Control c in root.Controls) + { + Control t = FindControlIterative(c, id); + if(t != null) return t; + } + return null; + } + + /// + /// Check if the input is a valid url. + /// + /// + /// Returns input if it's a valid url. If the input is not a valid url, returns empty string. + public static string CleanUrl(string url) + { + if(string.IsNullOrWhiteSpace(url)) + { + return string.Empty; + } + + string prefix = "http"; + + if(url.Substring(0, prefix.Length) != prefix) + { + url = prefix + "://" + url; + } + + using(var client = new MyClient()) + { + client.HeadOnly = true; + try + { + client.DownloadString(url); + } + catch(WebException) + { + url = string.Empty; + } + + return url; + } + + } + + private class MyClient : WebClient + { + public bool HeadOnly { get; set; } + + protected override WebRequest GetWebRequest(Uri address) + { + WebRequest req = base.GetWebRequest(address); + if(HeadOnly && req.Method == "GET") + { + req.Method = "HEAD"; + } + return req; + } + } + + } +} diff --git a/MixERP.Net.Common/Properties/AssemblyInfo.cs b/MixERP.Net.Common/Properties/AssemblyInfo.cs new file mode 100644 index 000000000..ff13b56ca --- /dev/null +++ b/MixERP.Net.Common/Properties/AssemblyInfo.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.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("MixERP.Net.Common")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("MixERP.Net.Common")] +[assembly: AssemblyCopyright("Copyright © 2013")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] +[assembly: CLSCompliant(true)] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("d97d61cb-d3d4-4936-93c9-67e7b3af1ee9")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/MixERP.Net.DatabaseLayer/Core/Accounts.cs b/MixERP.Net.DatabaseLayer/Core/Accounts.cs new file mode 100644 index 000000000..67dfa15b9 --- /dev/null +++ b/MixERP.Net.DatabaseLayer/Core/Accounts.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.Text; +using Npgsql; + +namespace MixERP.Net.DatabaseLayer.Core +{ + public static class Accounts + { + public static bool IsCashAccount(int accountId) + { + string sql = "SELECT 1 FROM core.accounts WHERE is_cash=true AND account_id=@AccountId;"; + using(NpgsqlCommand command = new NpgsqlCommand(sql)) + { + command.Parameters.AddWithValue("@AccountId", accountId); + + return MixERP.Net.DatabaseLayer.DBFactory.DBOperations.GetDataTable(command).Rows.Count.Equals(1); + } + } + + public static bool IsCashAccount(string accountCode) + { + string sql = "SELECT 1 FROM core.accounts WHERE is_cash=true AND account_code=@AccountCode;"; + using(NpgsqlCommand command = new NpgsqlCommand(sql)) + { + command.Parameters.AddWithValue("@AccountCode", accountCode); + + return MixERP.Net.DatabaseLayer.DBFactory.DBOperations.GetDataTable(command).Rows.Count.Equals(1); + } + } + } +} diff --git a/MixERP.Net.DatabaseLayer/Core/Items.cs b/MixERP.Net.DatabaseLayer/Core/Items.cs new file mode 100644 index 000000000..c878af537 --- /dev/null +++ b/MixERP.Net.DatabaseLayer/Core/Items.cs @@ -0,0 +1,90 @@ +/******************************************************************************** +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 Npgsql; + +namespace MixERP.Net.DatabaseLayer.Core +{ + public static class Items + { + public static bool ItemExistsByCode(string itemCode) + { + string sql = "SELECT 1 FROM core.items WHERE core.items.item_code=@ItemCode;"; + using (NpgsqlCommand command = new NpgsqlCommand(sql)) + { + command.Parameters.AddWithValue("@ItemCode", itemCode); + + return MixERP.Net.DatabaseLayer.DBFactory.DBOperations.GetScalarValue(command).ToString().Equals("1"); + } + } + + public static decimal GetItemSellingPrice(string itemCode, string partyCode, int priceTypeId, int unitId) + { + string sql = "SELECT core.get_item_selling_price(core.get_item_id_by_item_code(@ItemCode), core.get_party_type_id_by_party_code(@PartyCode), @PriceTypeId, @UnitId);"; + using(NpgsqlCommand command = new NpgsqlCommand(sql)) + { + command.Parameters.AddWithValue("@ItemCode", itemCode); + command.Parameters.AddWithValue("@PartyCode", partyCode); + command.Parameters.AddWithValue("@PriceTypeId", priceTypeId); + command.Parameters.AddWithValue("@UnitId", unitId); + + return MixERP.Net.Common.Conversion.TryCastDecimal(MixERP.Net.DatabaseLayer.DBFactory.DBOperations.GetScalarValue(command)); + } + } + + public static decimal GetItemCostPrice(string itemCode, string partyCode, int unitId) + { + string sql = "SELECT core.get_item_cost_price(core.get_item_id_by_item_code(@ItemCode), core.get_party_id_by_party_code(@PartyCode), @UnitId);"; + using(NpgsqlCommand command = new NpgsqlCommand(sql)) + { + command.Parameters.AddWithValue("@ItemCode", itemCode); + command.Parameters.AddWithValue("@PartyCode", partyCode); + command.Parameters.AddWithValue("@UnitId", unitId); + + return MixERP.Net.Common.Conversion.TryCastDecimal(MixERP.Net.DatabaseLayer.DBFactory.DBOperations.GetScalarValue(command)); + } + } + + public static decimal GetTaxRate(string itemCode) + { + string sql = "SELECT core.get_item_tax_rate(core.get_item_id_by_item_code(@ItemCode));"; + using (NpgsqlCommand command = new NpgsqlCommand(sql)) + { + command.Parameters.AddWithValue("@ItemCode", itemCode); + return MixERP.Net.Common.Conversion.TryCastDecimal(MixERP.Net.DatabaseLayer.DBFactory.DBOperations.GetScalarValue(command)); + } + } + + public static decimal CountItemInStock(string itemCode, int unitId, int storeId) + { + string sql = "SELECT core.count_item_in_stock(core.get_item_id_by_item_code(@ItemCode), @UnitId, @StoreId);"; + using(NpgsqlCommand command = new NpgsqlCommand(sql)) + { + command.Parameters.AddWithValue("@ItemCode", itemCode); + command.Parameters.AddWithValue("@UnitId", unitId); + command.Parameters.AddWithValue("@StoreId", storeId); + return MixERP.Net.Common.Conversion.TryCastDecimal(MixERP.Net.DatabaseLayer.DBFactory.DBOperations.GetScalarValue(command)); + } + } + + public static bool IsStockItem(string itemCode) + { + string sql = "SELECT 1 FROM core.items WHERE item_code=@ItemCode AND maintain_stock=true;"; + using(NpgsqlCommand command = new NpgsqlCommand(sql)) + { + command.Parameters.AddWithValue("@ItemCode", itemCode); + + return MixERP.Net.DatabaseLayer.DBFactory.DBOperations.GetDataTable(command).Rows.Count.Equals(1); + } + } + + } +} diff --git a/MixERP.Net.DatabaseLayer/Core/Menu.cs b/MixERP.Net.DatabaseLayer/Core/Menu.cs new file mode 100644 index 000000000..a04123eb2 --- /dev/null +++ b/MixERP.Net.DatabaseLayer/Core/Menu.cs @@ -0,0 +1,62 @@ +/******************************************************************************** +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 Npgsql; + +namespace MixERP.Net.DatabaseLayer.Core +{ + public static class Menu + { + public static DataTable GetMenuTable(string path, short level) + { + string sql = "SELECT * FROM core.menus WHERE parent_menu_id=(SELECT menu_id FROM core.menus WHERE url=@url) AND level=@Level ORDER BY menu_id;"; + using (NpgsqlCommand command = new NpgsqlCommand(sql)) + { + command.Parameters.AddWithValue("@Url", path); + command.Parameters.AddWithValue("@Level", level); + + return MixERP.Net.DatabaseLayer.DBFactory.DBOperations.GetDataTable(command); + } + } + + public static DataTable GetRootMenuTable(string path) + { + string sql = "SELECT * FROM core.menus WHERE parent_menu_id=core.get_root_parent_menu_id(@url) ORDER BY menu_id;"; + using (NpgsqlCommand command = new NpgsqlCommand(sql)) + { + command.Parameters.AddWithValue("@Url", path); + return MixERP.Net.DatabaseLayer.DBFactory.DBOperations.GetDataTable(command); + } + } + + public static DataTable GetMenuTable(int parentMenuId, short level) + { + string sql = "SELECT * FROM core.menus WHERE parent_menu_id is null ORDER BY menu_id;"; + + if (parentMenuId > 0) + { + sql = "SELECT * FROM core.menus WHERE parent_menu_id=@ParentMenuId AND level=@Level ORDER BY menu_id;"; + } + + using (NpgsqlCommand command = new NpgsqlCommand(sql)) + { + if (parentMenuId > 0) + { + command.Parameters.AddWithValue("@ParentMenuId", parentMenuId); + command.Parameters.AddWithValue("@Level", level); + } + + return MixERP.Net.DatabaseLayer.DBFactory.DBOperations.GetDataTable(command); + } + } + } +} diff --git a/MixERP.Net.DatabaseLayer/Core/Parties.cs b/MixERP.Net.DatabaseLayer/Core/Parties.cs new file mode 100644 index 000000000..b16df9a69 --- /dev/null +++ b/MixERP.Net.DatabaseLayer/Core/Parties.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.Data; +using System.Linq; +using System.Text; +using Npgsql; + +namespace MixERP.Net.DatabaseLayer.Core +{ + public static class Parties + { + public static bool IsCreditAllowed(string partyCode) + { + string sql = "SELECT 1 FROM core.parties WHERE party_code=@PartyCode and allow_credit=true;"; + + using(NpgsqlCommand command = new NpgsqlCommand(sql)) + { + command.Parameters.AddWithValue("@PartyCode", partyCode); + return MixERP.Net.DatabaseLayer.DBFactory.DBOperations.GetDataTable(command).Rows.Count.Equals(1); + } + } + } +} diff --git a/MixERP.Net.DatabaseLayer/Core/ShippingAddresses.cs b/MixERP.Net.DatabaseLayer/Core/ShippingAddresses.cs new file mode 100644 index 000000000..b6ed66d32 --- /dev/null +++ b/MixERP.Net.DatabaseLayer/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; +using Npgsql; + +namespace MixERP.Net.DatabaseLayer.Core +{ + public static class ShippingAddresses + { + public static DataTable GetShippingAddressView(int partyId) + { + string sql = "SELECT * FROM core.shipping_address_view WHERE party_id=@PartyId;"; + using(NpgsqlCommand command = new NpgsqlCommand(sql)) + { + command.Parameters.AddWithValue("@PartyId", partyId); + + return MixERP.Net.DatabaseLayer.DBFactory.DBOperations.GetDataTable(command); + } + } + + public static DataTable GetShippingAddressView(string partyCode) + { + string sql = "SELECT * FROM core.shipping_address_view WHERE party_id = core.get_party_id_by_party_code(@PartyCode);"; + using(NpgsqlCommand command = new NpgsqlCommand(sql)) + { + command.Parameters.AddWithValue("@PartyCode", partyCode); + + return MixERP.Net.DatabaseLayer.DBFactory.DBOperations.GetDataTable(command); + } + } + } +} diff --git a/MixERP.Net.DatabaseLayer/Core/Units.cs b/MixERP.Net.DatabaseLayer/Core/Units.cs new file mode 100644 index 000000000..92866e7b1 --- /dev/null +++ b/MixERP.Net.DatabaseLayer/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; +using Npgsql; + +namespace MixERP.Net.DatabaseLayer.Core +{ + public static class Units + { + public static DataTable GetUnitViewByItemCode(string itemCode) + { + string sql = "SELECT * FROM core.get_associated_units_from_item_code(@ItemCode);"; + using (NpgsqlCommand command = new NpgsqlCommand(sql)) + { + command.Parameters.AddWithValue("@ItemCode", itemCode); + + return MixERP.Net.DatabaseLayer.DBFactory.DBOperations.GetDataTable(command); + } + } + + public static bool UnitExistsByName(string unitName) + { + string sql = "SELECT 1 FROM core.units WHERE core.units.unit_name=@UnitName;"; + using (NpgsqlCommand command = new NpgsqlCommand(sql)) + { + command.Parameters.AddWithValue("@UnitName", unitName); + + return MixERP.Net.DatabaseLayer.DBFactory.DBOperations.GetScalarValue(command).ToString().Equals("1"); + } + } + } +} diff --git a/MixERP.Net.DatabaseLayer/DBFactory/DBConnection.cs b/MixERP.Net.DatabaseLayer/DBFactory/DBConnection.cs new file mode 100644 index 000000000..e0449bb14 --- /dev/null +++ b/MixERP.Net.DatabaseLayer/DBFactory/DBConnection.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.DatabaseLayer.DBFactory +{ + public static class DBConnection + { + public static string ConnectionString() + { + Npgsql.NpgsqlConnectionStringBuilder connectionStringBuilder = new Npgsql.NpgsqlConnectionStringBuilder(); + connectionStringBuilder.Host = MixERP.Net.Common.Conversion.TryCastString(System.Configuration.ConfigurationManager.AppSettings["Server"]); + connectionStringBuilder.Database = MixERP.Net.Common.Conversion.TryCastString(System.Configuration.ConfigurationManager.AppSettings["Database"]); + connectionStringBuilder.UserName = MixERP.Net.Common.Conversion.TryCastString(System.Configuration.ConfigurationManager.AppSettings["UserId"]); + connectionStringBuilder.Password = MixERP.Net.Common.Conversion.TryCastString(System.Configuration.ConfigurationManager.AppSettings["Password"]); + connectionStringBuilder.Timeout = 600; + + return connectionStringBuilder.ConnectionString; + } + } +} diff --git a/MixERP.Net.DatabaseLayer/DBFactory/DBOperations.cs b/MixERP.Net.DatabaseLayer/DBFactory/DBOperations.cs new file mode 100644 index 000000000..c3ce5a132 --- /dev/null +++ b/MixERP.Net.DatabaseLayer/DBFactory/DBOperations.cs @@ -0,0 +1,154 @@ +/******************************************************************************** +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.Globalization; +using System.Data; +using Npgsql; + +namespace MixERP.Net.DatabaseLayer.DBFactory +{ + public static class DBOperations + { + public static bool ExecuteNonQuery(Npgsql.NpgsqlCommand command) + { + if(command != null) + { + using(Npgsql.NpgsqlConnection connection = new Npgsql.NpgsqlConnection(MixERP.Net.DatabaseLayer.DBFactory.DBConnection.ConnectionString())) + { + try + { + command.Connection = connection; + command.CommandTimeout = 300; + connection.Open(); + + command.ExecuteNonQuery(); + return true; + } + catch + { + throw; + } + } + } + + return false; + } + + public static object GetScalarValue(Npgsql.NpgsqlCommand command) + { + if(command != null) + { + using(Npgsql.NpgsqlConnection connection = new Npgsql.NpgsqlConnection(MixERP.Net.DatabaseLayer.DBFactory.DBConnection.ConnectionString())) + { + command.Connection = connection; + command.CommandTimeout = 300; + connection.Open(); + return command.ExecuteScalar(); + } + } + + return null; + } + + public static DataTable GetDataTable(Npgsql.NpgsqlCommand command) + { + if(command != null) + { + using(Npgsql.NpgsqlConnection connection = new Npgsql.NpgsqlConnection(MixERP.Net.DatabaseLayer.DBFactory.DBConnection.ConnectionString())) + { + command.Connection = connection; + command.CommandTimeout = 300; + + using(NpgsqlDataAdapter adapter = new NpgsqlDataAdapter(command)) + { + using(DataTable dataTable = new DataTable()) + { + dataTable.Locale = CultureInfo.InvariantCulture; + adapter.Fill(dataTable); + return dataTable; + } + } + } + } + + return null; + } + + public static Npgsql.NpgsqlDataReader GetDataReader(Npgsql.NpgsqlCommand command) + { + if(command != null) + { + Npgsql.NpgsqlDataReader reader = default(Npgsql.NpgsqlDataReader); + using(Npgsql.NpgsqlConnection connection = new Npgsql.NpgsqlConnection(MixERP.Net.DatabaseLayer.DBFactory.DBConnection.ConnectionString())) + { + command.Connection = connection; + command.CommandTimeout = 300; + + command.Connection.Open(); + reader = command.ExecuteReader(CommandBehavior.CloseConnection); + return reader; + } + } + + return null; + } + + public static DataView GetDataView(Npgsql.NpgsqlCommand command) + { + if(command != null) + { + using(DataView view = new DataView(GetDataTable(command))) + { + return view; + } + } + + return null; + } + + public static Npgsql.NpgsqlDataAdapter GetDataAdapter(Npgsql.NpgsqlCommand command) + { + if(command != null) + { + using(Npgsql.NpgsqlConnection connection = new Npgsql.NpgsqlConnection(MixERP.Net.DatabaseLayer.DBFactory.DBConnection.ConnectionString())) + { + command.Connection = connection; + command.CommandTimeout = 300; + + using(Npgsql.NpgsqlDataAdapter adapter = new Npgsql.NpgsqlDataAdapter(command)) + { + return adapter; + } + } + } + + return null; + } + + public static DataSet GetDataSet(Npgsql.NpgsqlCommand command) + { + if(command != null) + { + using(Npgsql.NpgsqlDataAdapter adapter = GetDataAdapter(command)) + { + using(DataSet set = new DataSet()) + { + adapter.Fill(set); + set.Locale = CultureInfo.CurrentUICulture; + return set; + } + } + } + + return null; + } + } +} diff --git a/MixERP.Net.DatabaseLayer/DBFactory/Sanitizer.cs b/MixERP.Net.DatabaseLayer/DBFactory/Sanitizer.cs new file mode 100644 index 000000000..d9a32e015 --- /dev/null +++ b/MixERP.Net.DatabaseLayer/DBFactory/Sanitizer.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.Data.Common; +using System.Linq; +using System.Text; +using System.Text.RegularExpressions; + +namespace MixERP.Net.DatabaseLayer.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) + { + if(string.IsNullOrWhiteSpace(identifier)) + { + return null; + } + + //No comment. + if(identifier.Contains("--")){return string.Empty;} + if(identifier.Contains("/*")){return string.Empty;} + + //Removing the match else than alphabets, numbers, and underscore. + return Regex.Replace(identifier, @"[^a-zA-Z0-9_]", ""); + } + + } +} diff --git a/MixERP.Net.DatabaseLayer/GlobalSuppressions.cs b/MixERP.Net.DatabaseLayer/GlobalSuppressions.cs new file mode 100644 index 000000000..739036c9b Binary files /dev/null and b/MixERP.Net.DatabaseLayer/GlobalSuppressions.cs differ diff --git a/MixERP.Net.DatabaseLayer/Helpers/FormHelper.cs b/MixERP.Net.DatabaseLayer/Helpers/FormHelper.cs new file mode 100644 index 000000000..496fbecc5 --- /dev/null +++ b/MixERP.Net.DatabaseLayer/Helpers/FormHelper.cs @@ -0,0 +1,352 @@ +/******************************************************************************** +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 Npgsql; +using System.Data; +using System.IO; +using System.Data.Common; + +namespace MixERP.Net.DatabaseLayer.Helpers +{ + public static class FormHelper + { + public static DataTable GetView(string tableSchema, string tableName, string orderBy, int limit, int offset) + { + string sql = "SELECT * FROM @TableSchema.@TableName ORDER BY @OrderBy LIMIT @Limit OFFSET @Offset;"; + + using(NpgsqlCommand command = new NpgsqlCommand()) + { + //We are 100% sure that the following paramters do not come from user input. + //Having said that, it is nice to sanitize the objects before sending it to the database server. + sql = sql.Replace("@TableSchema", DBFactory.Sanitizer.SanitizeIdentifierName(tableSchema)); + sql = sql.Replace("@TableName", DBFactory.Sanitizer.SanitizeIdentifierName(tableName)); + sql = sql.Replace("@OrderBy", DBFactory.Sanitizer.SanitizeIdentifierName(orderBy)); + sql = sql.Replace("@Limit", MixERP.Net.Common.Conversion.TryCastString(limit)); + sql = sql.Replace("@Offset", MixERP.Net.Common.Conversion.TryCastString(offset)); + command.CommandText = sql; + + return MixERP.Net.DatabaseLayer.DBFactory.DBOperations.GetDataTable(command); + } + } + + public static DataTable GetTable(string tableSchema, string tableName) + { + string sql = "SELECT * FROM @TableSchema.@TableName;"; + using(NpgsqlCommand command = new NpgsqlCommand()) + { + sql = sql.Replace("@TableSchema", DBFactory.Sanitizer.SanitizeIdentifierName(tableSchema)); + sql = sql.Replace("@TableName", DBFactory.Sanitizer.SanitizeIdentifierName(tableName)); + command.CommandText = sql; + + return MixERP.Net.DatabaseLayer.DBFactory.DBOperations.GetDataTable(command); + } + } + + public static DataTable GetTable(string tableSchema, string tableName, string columnNames, string columnValues) + { + if(string.IsNullOrWhiteSpace(columnNames)) + { + return null; + } + + if(string.IsNullOrWhiteSpace(columnValues)) + { + return null; + } + + string[] columns = columnNames.Split(','); + string[] values = columnValues.Split(','); + + if(!columns.Count().Equals(values.Count())) + { + return null; + } + + int counter = 0; + string sql = "SELECT * FROM @TableSchema.@TableName WHERE "; + + foreach(string column in columns) + { + if(!counter.Equals(0)) + { + sql += " AND "; + } + + sql += DBFactory.Sanitizer.SanitizeIdentifierName(column.Trim()) + " = @" + DBFactory.Sanitizer.SanitizeIdentifierName(column.Trim()); + + counter++; + } + + sql += ";"; + + using(NpgsqlCommand command = new NpgsqlCommand()) + { + sql = sql.Replace("@TableSchema", DBFactory.Sanitizer.SanitizeIdentifierName(tableSchema)); + sql = sql.Replace("@TableName", DBFactory.Sanitizer.SanitizeIdentifierName(tableName)); + + + command.CommandText = sql; + + counter = 0; + foreach(string column in columns) + { + command.Parameters.AddWithValue(DBFactory.Sanitizer.SanitizeIdentifierName(column.Trim()), values[counter]); + counter++; + } + + + return MixERP.Net.DatabaseLayer.DBFactory.DBOperations.GetDataTable(command); + } + } + + + [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Security", "CA2100:Review SQL queries for security vulnerabilities")] + public static DataTable GetTable(string tableSchema, string tableName, string columnNames, string columnValuesLike, int limit) + { + if(columnNames == null) + { + columnNames = string.Empty; + } + + if(columnValuesLike == null) + { + columnValuesLike = string.Empty; + } + + string[] columns = columnNames.Split(','); + string[] values = columnValuesLike.Split(','); + + if(!columns.Count().Equals(values.Count())) + { + return null; + } + + int counter = 0; + string sql = "SELECT * FROM @TableSchema.@TableName "; + + foreach(string column in columns) + { + if(!string.IsNullOrWhiteSpace(column)) + { + if(counter.Equals(0)) + { + sql += " WHERE "; + } + else + { + sql += " AND "; + } + + sql += " lower(" + DBFactory.Sanitizer.SanitizeIdentifierName(column.Trim()) + "::text) LIKE @" + DBFactory.Sanitizer.SanitizeIdentifierName(column.Trim()); + counter++; + } + } + + sql += " LIMIT @Limit;"; + + using(NpgsqlCommand command = new NpgsqlCommand()) + { + sql = sql.Replace("@TableSchema", DBFactory.Sanitizer.SanitizeIdentifierName(tableSchema)); + sql = sql.Replace("@TableName", DBFactory.Sanitizer.SanitizeIdentifierName(tableName)); + + + command.CommandText = sql; + + counter = 0; + foreach(string column in columns) + { + if(!string.IsNullOrWhiteSpace(column)) + { + command.Parameters.AddWithValue(DBFactory.Sanitizer.SanitizeIdentifierName(column.Trim()), "%" + values[counter].ToLower(System.Threading.Thread.CurrentThread.CurrentCulture) + "%"); + counter++; + } + } + + command.Parameters.AddWithValue("@Limit", limit); + + return MixERP.Net.DatabaseLayer.DBFactory.DBOperations.GetDataTable(command); + } + } + + + public static int GetTotalRecords(string tableSchema, string tableName) + { + string sql = "SELECT COUNT(*) FROM @TableSchema.@TableName"; + using(NpgsqlCommand command = new NpgsqlCommand()) + { + sql = sql.Replace("@TableSchema", DBFactory.Sanitizer.SanitizeIdentifierName(tableSchema)); + sql = sql.Replace("@TableName", DBFactory.Sanitizer.SanitizeIdentifierName(tableName)); + + command.CommandText = sql; + + return MixERP.Net.Common.Conversion.TryCastInteger(MixERP.Net.DatabaseLayer.DBFactory.DBOperations.GetScalarValue(command)); + } + } + + [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2202:Do not dispose objects multiple times"), System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Security", "CA2100:Review SQL queries for security vulnerabilities")] + public static bool InsertRecord(int userId, string tableSchema, string tableName, System.Collections.ObjectModel.Collection> data, string imageColumn) + { + if(data == null) + { + return false; + } + + string columns = string.Empty; + string columnParamters = string.Empty; + + int counter = 0; + + foreach(KeyValuePair pair in data) + { + counter++; + + if(counter.Equals(1)) + { + columns += DBFactory.Sanitizer.SanitizeIdentifierName(pair.Key); + columnParamters += "@" + pair.Key; + } + else + { + columns += ", " + DBFactory.Sanitizer.SanitizeIdentifierName(pair.Key); + columnParamters += ", @" + pair.Key; + } + } + + string sql = "INSERT INTO @TableSchema.@TableName(" + columns + ", audit_user_id) SELECT " + columnParamters + ", @AuditUserId;"; + using(NpgsqlCommand command = new NpgsqlCommand()) + { + sql = sql.Replace("@TableSchema", DBFactory.Sanitizer.SanitizeIdentifierName(tableSchema)); + sql = sql.Replace("@TableName", DBFactory.Sanitizer.SanitizeIdentifierName(tableName)); + + command.CommandText = sql; + + foreach(KeyValuePair pair in data) + { + if(string.IsNullOrWhiteSpace(pair.Value)) + { + command.Parameters.AddWithValue("@" + pair.Key, DBNull.Value); + } + else + { + if(pair.Key.Equals(imageColumn)) + { + using(FileStream stream = new FileStream(pair.Value, FileMode.Open, FileAccess.Read)) + { + using(BinaryReader reader = new BinaryReader(new BufferedStream(stream))) + { + byte[] byteArray = reader.ReadBytes(Convert.ToInt32(stream.Length)); + command.Parameters.AddWithValue("@" + pair.Key, byteArray); + } + } + } + else + { + command.Parameters.AddWithValue("@" + pair.Key, pair.Value); + } + } + } + + command.Parameters.AddWithValue("@AuditUserId", userId); + + return MixERP.Net.DatabaseLayer.DBFactory.DBOperations.ExecuteNonQuery(command); + } + } + + [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Security", "CA2100:Review SQL queries for security vulnerabilities")] + public static bool UpdateRecord(int userId, string tableSchema, string tableName, System.Collections.ObjectModel.Collection> data, string keyColumn, string keyColumnValue, string imageColumn) + { + if(data == null) + { + return false; + } + + string columns = string.Empty; + + int counter = 0; + + //Adding the current user to the column collection. + KeyValuePair auditUserId = new KeyValuePair("audit_user_id", userId.ToString(System.Threading.Thread.CurrentThread.CurrentCulture)); + data.Add(auditUserId); + + foreach(KeyValuePair pair in data) + { + counter++; + + if(counter.Equals(1)) + { + columns += DBFactory.Sanitizer.SanitizeIdentifierName(pair.Key) + "=@" + pair.Key; + } + else + { + columns += ", " + DBFactory.Sanitizer.SanitizeIdentifierName(pair.Key) + "=@" + pair.Key; + } + } + + string sql = "UPDATE @TableSchema.@TableName SET " + columns + " WHERE @KeyColumn=@KeyValue;"; + + using(NpgsqlCommand command = new NpgsqlCommand()) + { + sql = sql.Replace("@TableSchema", DBFactory.Sanitizer.SanitizeIdentifierName(tableSchema)); + sql = sql.Replace("@TableName", DBFactory.Sanitizer.SanitizeIdentifierName(tableName)); + sql = sql.Replace("@KeyColumn", DBFactory.Sanitizer.SanitizeIdentifierName(keyColumn)); + + command.CommandText = sql; + + foreach(KeyValuePair pair in data) + { + if(string.IsNullOrWhiteSpace(pair.Value)) + { + command.Parameters.AddWithValue("@" + pair.Key, DBNull.Value); + } + else + { + if(pair.Key.Equals(imageColumn)) + { + using(FileStream stream = new FileStream(pair.Value, FileMode.Open, FileAccess.Read)) + { + using(BinaryReader reader = new BinaryReader(new BufferedStream(stream))) + { + byte[] byteArray = reader.ReadBytes(Convert.ToInt32(stream.Length)); + command.Parameters.AddWithValue("@" + pair.Key, byteArray); + } + } + } + else + { + command.Parameters.AddWithValue("@" + pair.Key, pair.Value); + } + } + } + + command.Parameters.AddWithValue("@KeyValue", keyColumnValue); + + return MixERP.Net.DatabaseLayer.DBFactory.DBOperations.ExecuteNonQuery(command); + } + } + + public static bool DeleteRecord(string tableSchema, string tableName, string keyColumn, string keyColumnValue) + { + string sql = "DELETE FROM @TableSchema.@TableName WHERE @KeyColumn=@KeyValue"; + + using(NpgsqlCommand command = new NpgsqlCommand()) + { + sql = sql.Replace("@TableSchema", DBFactory.Sanitizer.SanitizeIdentifierName(tableSchema)); + sql = sql.Replace("@TableName", DBFactory.Sanitizer.SanitizeIdentifierName(tableName)); + sql = sql.Replace("@KeyColumn", DBFactory.Sanitizer.SanitizeIdentifierName(keyColumn)); + command.CommandText = sql; + + command.Parameters.AddWithValue("@KeyValue", keyColumnValue); + + return MixERP.Net.DatabaseLayer.DBFactory.DBOperations.ExecuteNonQuery(command); + } + } + } +} diff --git a/MixERP.Net.DatabaseLayer/Helpers/Maintenance.cs b/MixERP.Net.DatabaseLayer/Helpers/Maintenance.cs new file mode 100644 index 000000000..a3d2fc0b7 --- /dev/null +++ b/MixERP.Net.DatabaseLayer/Helpers/Maintenance.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.DatabaseLayer.Helpers +{ + public static class Maintenance + { + public static void Vacuum() + { + string sql = "VACUUM;"; + using (Npgsql.NpgsqlCommand command = new Npgsql.NpgsqlCommand(sql)) + { + command.CommandTimeout = 3600; + MixERP.Net.DatabaseLayer.DBFactory.DBOperations.ExecuteNonQuery(command); + } + } + + public static void VacuumFull() + { + string sql = "VACUUM FULL;"; + using (Npgsql.NpgsqlCommand command = new Npgsql.NpgsqlCommand(sql)) + { + command.CommandTimeout = 3600; + MixERP.Net.DatabaseLayer.DBFactory.DBOperations.ExecuteNonQuery(command); + } + } + + public static void Analyze() + { + string sql = "ANALYZE;"; + using (Npgsql.NpgsqlCommand command = new Npgsql.NpgsqlCommand(sql)) + { + command.CommandTimeout = 3600; + MixERP.Net.DatabaseLayer.DBFactory.DBOperations.ExecuteNonQuery(command); + } + } + } +} diff --git a/MixERP.Net.DatabaseLayer/Helpers/ReportHelper.cs b/MixERP.Net.DatabaseLayer/Helpers/ReportHelper.cs new file mode 100644 index 000000000..35ae3af2c --- /dev/null +++ b/MixERP.Net.DatabaseLayer/Helpers/ReportHelper.cs @@ -0,0 +1,44 @@ +/******************************************************************************** +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.Specialized; +using System.Data; +using System.Data.SqlClient; +using System.Linq; +using System.Text; +using Npgsql; + +namespace MixERP.Net.DatabaseLayer.Helpers +{ + public static class ReportHelper + { + [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Security", "CA2100:Review SQL queries for security vulnerabilities")] + public static DataTable GetDataTable(string sql, System.Collections.ObjectModel.Collection> parameters) + { + if(string.IsNullOrWhiteSpace(sql)) + { + return null; + } + + + using(NpgsqlCommand command = new NpgsqlCommand(sql)) + { + if(parameters != null) + { + foreach(KeyValuePair p in parameters) + { + command.Parameters.AddWithValue(p.Key, p.Value); + } + } + + return MixERP.Net.DatabaseLayer.DBFactory.DBOperations.GetDataTable(command); + } + } + } +} diff --git a/MixERP.Net.DatabaseLayer/Helpers/TableHelper.cs b/MixERP.Net.DatabaseLayer/Helpers/TableHelper.cs new file mode 100644 index 000000000..87dc74dd5 --- /dev/null +++ b/MixERP.Net.DatabaseLayer/Helpers/TableHelper.cs @@ -0,0 +1,60 @@ +/******************************************************************************** +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 Npgsql; + +namespace MixERP.Net.DatabaseLayer.Helpers +{ + public static class TableHelper + { + public static DataTable GetTable(string schema, string tableName, string exclusion) + { + string sql = string.Empty; + + if (!string.IsNullOrWhiteSpace(exclusion)) + { + string[] exclusions = exclusion.Split(','); + string[] paramNames = exclusions.Select((s, i) => "@Paramter" + i.ToString(System.Threading.Thread.CurrentThread.CurrentCulture).Trim()).ToArray(); + string inClause = string.Join(",", paramNames); + + sql= string.Format(System.Threading.Thread.CurrentThread.CurrentCulture, "select * from core.mixerp_table_view where table_schema=@Schema AND table_name=@TableName AND column_name NOT IN({0});", inClause); + + using (NpgsqlCommand command = new NpgsqlCommand(sql)) + { + command.Parameters.AddWithValue("@Schema", schema); + command.Parameters.AddWithValue("@TableName", tableName); + + for (int i = 0; i < paramNames.Length; i++) + { + command.Parameters.AddWithValue(paramNames[i], exclusions[i].Trim()); + } + + return MixERP.Net.DatabaseLayer.DBFactory.DBOperations.GetDataTable(command); + } + } + else + { + sql = "select * from core.mixerp_table_view where table_schema=@Schema AND table_name=@TableName;"; + + using (NpgsqlCommand command = new NpgsqlCommand(sql)) + { + command.Parameters.AddWithValue("@Schema", schema); + command.Parameters.AddWithValue("@TableName", tableName); + + return MixERP.Net.DatabaseLayer.DBFactory.DBOperations.GetDataTable(command); + } + + } + } + + } +} diff --git a/MixERP.Net.DatabaseLayer/Mix Open Foundation.snk b/MixERP.Net.DatabaseLayer/Mix Open Foundation.snk new file mode 100644 index 000000000..11572dc3d Binary files /dev/null and b/MixERP.Net.DatabaseLayer/Mix Open Foundation.snk differ diff --git a/MixERP.Net.DatabaseLayer/MixERP.Net.DatabaseLayer.csproj b/MixERP.Net.DatabaseLayer/MixERP.Net.DatabaseLayer.csproj new file mode 100644 index 000000000..660c48341 --- /dev/null +++ b/MixERP.Net.DatabaseLayer/MixERP.Net.DatabaseLayer.csproj @@ -0,0 +1,117 @@ + + + + Debug + AnyCPU + 8.0.30703 + 2.0 + {F1F6FB95-5D7E-4E4C-9CC4-AC58DBD8F09F} + Library + Properties + MixERP.Net.DatabaseLayer + MixERP.Net.DatabaseLayer + v4.0 + 512 + + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + false + ..\MixERP.ruleset + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + false + + + true + + + Mix Open Foundation.snk + + + + False + ..\Dependencies\Npgsql\Mono.Security.dll + + + False + ..\Dependencies\Npgsql\Npgsql.dll + + + False + ..\Dependencies\Npgsql\policy.2.0.Npgsql.dll + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {D5A09C22-8F48-4FB2-A14D-C62C8C8FCEC0} + MixERP.Net.Common + + + + + + + + + + + + Dictionary.xml + + + + + \ No newline at end of file diff --git a/MixERP.Net.DatabaseLayer/MixERP.net.DatabaseLayer.licenseheader b/MixERP.Net.DatabaseLayer/MixERP.net.DatabaseLayer.licenseheader new file mode 100644 index 000000000..5f3dc8d98 --- /dev/null +++ b/MixERP.Net.DatabaseLayer/MixERP.net.DatabaseLayer.licenseheader @@ -0,0 +1,27 @@ +extensions: designer.cs generated.cs +extensions: .cs .cpp .h +/******************************************************************************** +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/. +***********************************************************************************/ +extensions: .aspx .ascx +<%-- +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/. +--%> +extensions: .vb +'Sample license text. +extensions: .xml .config .xsd + \ No newline at end of file diff --git a/MixERP.Net.DatabaseLayer/Office/CashRepositories.cs b/MixERP.Net.DatabaseLayer/Office/CashRepositories.cs new file mode 100644 index 000000000..a5b8c2cec --- /dev/null +++ b/MixERP.Net.DatabaseLayer/Office/CashRepositories.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.Data; +using System.Linq; +using System.Text; +using Npgsql; + +namespace MixERP.Net.DatabaseLayer.Office +{ + public static class CashRepositories + { + public static DataTable GetCashRepositories() + { + string sql = "SELECT * FROM office.cash_repositories;"; + using(NpgsqlCommand command = new NpgsqlCommand(sql)) + { + return MixERP.Net.DatabaseLayer.DBFactory.DBOperations.GetDataTable(command); + } + } + + public static DataTable GetCashRepositories(int officeId) + { + string sql = "SELECT * FROM office.cash_repositories WHERE office_id=@OfficeId;"; + using(NpgsqlCommand command = new NpgsqlCommand(sql)) + { + command.Parameters.AddWithValue("@OfficeId", officeId); + return MixERP.Net.DatabaseLayer.DBFactory.DBOperations.GetDataTable(command); + } + } + + public static decimal GetBalance(int cashRepositoryId) + { + string sql = "SELECT transactions.get_cash_repository_balance(@CashRepositoryId);"; + using(NpgsqlCommand command = new NpgsqlCommand(sql)) + { + command.Parameters.AddWithValue("@CashRepositoryId", cashRepositoryId); + return MixERP.Net.Common.Conversion.TryCastDecimal(MixERP.Net.DatabaseLayer.DBFactory.DBOperations.GetScalarValue(command)); + } + } + + } +} diff --git a/MixERP.Net.DatabaseLayer/Office/Offices.cs b/MixERP.Net.DatabaseLayer/Office/Offices.cs new file mode 100644 index 000000000..37768682f --- /dev/null +++ b/MixERP.Net.DatabaseLayer/Office/Offices.cs @@ -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/. +***********************************************************************************/ +using System; +using System.Collections.Generic; +using System.Data; +using System.Linq; +using System.Text; +using Npgsql; + +namespace MixERP.Net.DatabaseLayer.Office +{ + public static class Offices + { + public static DataTable GetOffices() + { + string sql = "SELECT * FROM office.get_offices();"; + using (NpgsqlCommand command = new NpgsqlCommand(sql)) + { + return MixERP.Net.DatabaseLayer.DBFactory.DBOperations.GetDataTable(command); + } + } + } +} diff --git a/MixERP.Net.DatabaseLayer/Office/Stores.cs b/MixERP.Net.DatabaseLayer/Office/Stores.cs new file mode 100644 index 000000000..af3b60be8 --- /dev/null +++ b/MixERP.Net.DatabaseLayer/Office/Stores.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.Data; +using System.Linq; +using System.Text; +using Npgsql; + +namespace MixERP.Net.DatabaseLayer.Office +{ + public static class Stores + { + public static bool IsSalesAllowed(int storeId) + { + string sql = "SELECT 1 FROM office.stores WHERE store_id=@StoreId and allow_sales='yes';"; + + using(NpgsqlCommand command = new NpgsqlCommand(sql)) + { + command.Parameters.AddWithValue("@StoreId", storeId); + return MixERP.Net.DatabaseLayer.DBFactory.DBOperations.GetDataTable(command).Rows.Count.Equals(1); + } + } + } +} diff --git a/MixERP.Net.DatabaseLayer/Properties/AssemblyInfo.cs b/MixERP.Net.DatabaseLayer/Properties/AssemblyInfo.cs new file mode 100644 index 000000000..5fedeaa0a --- /dev/null +++ b/MixERP.Net.DatabaseLayer/Properties/AssemblyInfo.cs @@ -0,0 +1,44 @@ +/******************************************************************************** +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.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("MixERP.Net.DatabaseLayer")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("MixERP.Net.DatabaseLayer")] +[assembly: AssemblyCopyright("Copyright © 2013")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] +[assembly: CLSCompliant(true)] +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("363a7a87-ee77-447a-ace5-def52235c5e9")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/MixERP.Net.DatabaseLayer/Security/User.cs b/MixERP.Net.DatabaseLayer/Security/User.cs new file mode 100644 index 000000000..1cbcd8846 --- /dev/null +++ b/MixERP.Net.DatabaseLayer/Security/User.cs @@ -0,0 +1,48 @@ +/******************************************************************************** +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.Text; +using Npgsql; + +namespace MixERP.Net.DatabaseLayer.Security +{ + public static class User + { + + public static long SignIn(int officeId, string userName, string password, string browser, string ipAddress, string remoteUser) + { + string sql = "SELECT * FROM office.sign_in(@OfficeId, @UserName, @Password, @Browser, @IPAddress, @RemoteUser);"; + using (NpgsqlCommand command = new NpgsqlCommand(sql)) + { + command.Parameters.AddWithValue("@OfficeId", officeId); + command.Parameters.AddWithValue("@UserName", userName); + command.Parameters.AddWithValue("@Password", password); + command.Parameters.AddWithValue("@Browser", browser); + command.Parameters.AddWithValue("@IPAddress", ipAddress); + command.Parameters.AddWithValue("@RemoteUser", remoteUser); + + return MixERP.Net.Common.Conversion.TryCastLong(MixERP.Net.DatabaseLayer.DBFactory.DBOperations.GetScalarValue(command)); + } + } + + public static DataTable GetUserTable(string userName) + { + string sql = "SELECT * FROM office.login_view WHERE user_name=@UserName;"; + using (NpgsqlCommand command = new NpgsqlCommand(sql)) + { + command.Parameters.AddWithValue("@UserName", userName); + + return MixERP.Net.DatabaseLayer.DBFactory.DBOperations.GetDataTable(command); + } + } + } +} diff --git a/MixERP.Net.DatabaseLayer/Transactions/DirectPurchase.cs b/MixERP.Net.DatabaseLayer/Transactions/DirectPurchase.cs new file mode 100644 index 000000000..d918a89e7 --- /dev/null +++ b/MixERP.Net.DatabaseLayer/Transactions/DirectPurchase.cs @@ -0,0 +1,221 @@ +/******************************************************************************** +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.Data; +using System.Linq; +using System.Text; +using Npgsql; + +namespace MixERP.Net.DatabaseLayer.Transactions +{ + public static class DirectPurchase + { + + [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + public static long Add(DateTime valueDate, int officeId, int userId, long logOnId, int costCenterId, string referenceNumber, string statementReference, MixERP.Net.Common.Models.Transactions.StockMasterModel stockMaster, Collection details) + { + if(stockMaster == null) + { + return 0; + } + + if(details == null) + { + return 0; + } + + if(details.Count.Equals(0)) + { + return 0; + } + + string sql = string.Empty; + long transactionMasterId = 0; + long stockMasterId = 0; + + decimal total = details.Sum(d => (d.Price * d.Quantity)); + decimal discountTotal = details.Sum(d => d.Discount); + decimal taxTotal = details.Sum(d => d.Tax); + + string creditInvariantParameter = "Purchase.Payables"; + string purchaseInvariantParameter = "Purchase"; + string purchaseTaxInvariantParamter = "Purchase.Tax"; + string purchaseDiscountInvariantParameter = "Purchase.Discount"; + + + using(NpgsqlConnection connection = new NpgsqlConnection(DBFactory.DBConnection.ConnectionString())) + { + connection.Open(); + + using(NpgsqlTransaction transaction = connection.BeginTransaction()) + { + try + { + + #region TransactionMaster + sql = "INSERT INTO transactions.transaction_master(transaction_master_id, transaction_counter, transaction_code, book, value_date, user_id, login_id, office_id, cost_center_id, reference_number, statement_reference) SELECT nextval(pg_get_serial_sequence('transactions.transaction_master', 'transaction_master_id')), transactions.get_new_transaction_counter(@ValueDate), transactions.get_transaction_code(@ValueDate, @OfficeId, @UserId, @LogOnId), @Book, @ValueDate, @UserId, @LogOnId, @OfficeId, @CostCenterId, @ReferenceNumber, @StatementReference;SELECT currval(pg_get_serial_sequence('transactions.transaction_master', 'transaction_master_id'));"; + using(NpgsqlCommand tm = new NpgsqlCommand(sql, connection)) + { + tm.Parameters.AddWithValue("@ValueDate", valueDate); + tm.Parameters.AddWithValue("@OfficeId", officeId); + tm.Parameters.AddWithValue("@UserId", userId); + tm.Parameters.AddWithValue("@LogOnId", logOnId); + tm.Parameters.AddWithValue("@Book", "Purchase.Direct"); + tm.Parameters.AddWithValue("@CostCenterId", costCenterId); + tm.Parameters.AddWithValue("@ReferenceNumber", referenceNumber); + tm.Parameters.AddWithValue("@StatementReference", statementReference); + + transactionMasterId = MixERP.Net.Common.Conversion.TryCastLong(tm.ExecuteScalar()); + } + + #region TransactionDetails + sql = "INSERT INTO transactions.transaction_details(transaction_master_id, tran_type, account_id, statement_reference, cash_repository_id, amount) SELECT @TransactionMasterId, @TranType, core.get_account_id_by_parameter(@ParameterName), @StatementReference, @CashRepositoryId, @Amount;"; + + using(NpgsqlCommand purchaseRow = new NpgsqlCommand(sql, connection)) + { + purchaseRow.Parameters.AddWithValue("@TransactionMasterId", transactionMasterId); + purchaseRow.Parameters.AddWithValue("@TranType", "Dr"); + purchaseRow.Parameters.AddWithValue("@ParameterName", purchaseInvariantParameter); + purchaseRow.Parameters.AddWithValue("@StatementReference", statementReference); + purchaseRow.Parameters.AddWithValue("@CashRepositoryId", DBNull.Value); + purchaseRow.Parameters.AddWithValue("@Amount", total); + + purchaseRow.ExecuteNonQuery(); + } + + if(taxTotal > 0) + { + using(NpgsqlCommand taxRow = new NpgsqlCommand(sql, connection)) + { + taxRow.Parameters.AddWithValue("@TransactionMasterId", transactionMasterId); + taxRow.Parameters.AddWithValue("@TranType", "Dr"); + taxRow.Parameters.AddWithValue("@ParameterName", purchaseTaxInvariantParamter); + taxRow.Parameters.AddWithValue("@StatementReference", statementReference); + taxRow.Parameters.AddWithValue("@CashRepositoryId", DBNull.Value); + taxRow.Parameters.AddWithValue("@Amount", taxTotal); + taxRow.ExecuteNonQuery(); + } + } + + if(discountTotal > 0) + { + using(NpgsqlCommand discountRow = new NpgsqlCommand(sql, connection)) + { + discountRow.Parameters.AddWithValue("@TransactionMasterId", transactionMasterId); + discountRow.Parameters.AddWithValue("@TranType", "Cr"); + discountRow.Parameters.AddWithValue("@ParameterName", purchaseDiscountInvariantParameter); + discountRow.Parameters.AddWithValue("@StatementReference", statementReference); + discountRow.Parameters.AddWithValue("@CashRepositoryId", DBNull.Value); + discountRow.Parameters.AddWithValue("@Amount", discountTotal); + discountRow.ExecuteNonQuery(); + } + } + + if(stockMaster.IsCredit) + { + using(NpgsqlCommand creditRow = new NpgsqlCommand(sql, connection)) + { + creditRow.Parameters.AddWithValue("@TransactionMasterId", transactionMasterId); + creditRow.Parameters.AddWithValue("@TranType", "Cr"); + creditRow.Parameters.AddWithValue("@ParameterName", creditInvariantParameter); + creditRow.Parameters.AddWithValue("@StatementReference", statementReference); + creditRow.Parameters.AddWithValue("@CashRepositoryId", DBNull.Value); + creditRow.Parameters.AddWithValue("@Amount", total - discountTotal + taxTotal); + creditRow.ExecuteNonQuery(); + } + } + else + { + sql = "INSERT INTO transactions.transaction_details(transaction_master_id, tran_type, account_id, statement_reference, cash_repository_id, amount) SELECT @TransactionMasterId, @TranType, core.get_cash_account_id(), @StatementReference, @CashRepositoryId, @Amount;"; + + using(NpgsqlCommand cashRow = new NpgsqlCommand(sql, connection)) + { + cashRow.Parameters.AddWithValue("@TransactionMasterId", transactionMasterId); + cashRow.Parameters.AddWithValue("@TranType", "Cr"); + cashRow.Parameters.AddWithValue("@StatementReference", statementReference); + cashRow.Parameters.AddWithValue("@CashRepositoryId", stockMaster.CashRepositoryId); + cashRow.Parameters.AddWithValue("@Amount", total - discountTotal + taxTotal); + cashRow.ExecuteNonQuery(); + } + } + #endregion + #endregion + + #region StockMaster + + sql = "INSERT INTO transactions.stock_master(stock_master_id, transaction_master_id, party_id, is_credit, shipper_id, shipping_charge, store_id, cash_repository_id) SELECT nextval(pg_get_serial_sequence('transactions.stock_master', 'stock_master_id')), @TransactionMasterId, core.get_party_id_by_party_code(@PartyCode), @IsCredit, @ShipperId, @ShippingCharge, @StoreId, @CashRepositoryId; SELECT currval(pg_get_serial_sequence('transactions.stock_master', 'stock_master_id'));"; + + using(NpgsqlCommand stockMasterRow = new NpgsqlCommand(sql, connection)) + { + stockMasterRow.Parameters.AddWithValue("@TransactionMasterId", transactionMasterId); + stockMasterRow.Parameters.AddWithValue("@PartyCode", stockMaster.PartyCode); + stockMasterRow.Parameters.AddWithValue("@IsCredit", stockMaster.IsCredit); + + if(stockMaster.ShipperId.Equals(0)) + { + stockMasterRow.Parameters.AddWithValue("@ShipperId", DBNull.Value); + } + else + { + stockMasterRow.Parameters.AddWithValue("@ShipperId", stockMaster.ShipperId); + } + + stockMasterRow.Parameters.AddWithValue("@ShippingCharge", stockMaster.ShippingCharge); + + stockMasterRow.Parameters.AddWithValue("@StoreId", stockMaster.StoreId); + stockMasterRow.Parameters.AddWithValue("@CashRepositoryId", stockMaster.CashRepositoryId); + + stockMasterId = MixERP.Net.Common.Conversion.TryCastLong(stockMasterRow.ExecuteScalar()); + } + + #region StockDetails + sql = @"INSERT INTO + transactions.stock_details(stock_master_id, tran_type, store_id, item_id, quantity, unit_id, base_quantity, base_unit_id, price, discount, tax_rate, tax) + SELECT @StockMasterId, @TranType, @StoreId, core.get_item_id_by_item_code(@ItemCode), @Quantity, core.get_unit_id_by_unit_name(@UnitName), core.get_base_quantity_by_unit_name(@UnitName, @Quantity), core.get_base_unit_id_by_unit_name(@UnitName), @Price, @Discount, @TaxRate, @Tax;"; + + foreach(MixERP.Net.Common.Models.Transactions.StockMasterDetailModel model in details) + { + using(NpgsqlCommand stockMasterDetailRow = new NpgsqlCommand(sql, connection)) + { + stockMasterDetailRow.Parameters.AddWithValue("@StockMasterId", stockMasterId); + stockMasterDetailRow.Parameters.AddWithValue("@TranType", "Dr"); + stockMasterDetailRow.Parameters.AddWithValue("@StoreId", model.StoreId); + stockMasterDetailRow.Parameters.AddWithValue("@ItemCode", model.ItemCode); + stockMasterDetailRow.Parameters.AddWithValue("@Quantity", model.Quantity); + stockMasterDetailRow.Parameters.AddWithValue("@UnitName", model.UnitName); + stockMasterDetailRow.Parameters.AddWithValue("@Price", model.Price); + stockMasterDetailRow.Parameters.AddWithValue("@Discount", model.Discount); + stockMasterDetailRow.Parameters.AddWithValue("@TaxRate", model.TaxRate); + stockMasterDetailRow.Parameters.AddWithValue("@Tax", model.Tax); + + stockMasterDetailRow.ExecuteNonQuery(); + } + } + + #endregion + + #endregion + + transaction.Commit(); + return transactionMasterId; + } + catch(NpgsqlException) + { + transaction.Rollback(); + throw; + } + } + + return 0; + } + } + + } +} diff --git a/MixERP.Net.DatabaseLayer/Transactions/DirectSales.cs b/MixERP.Net.DatabaseLayer/Transactions/DirectSales.cs new file mode 100644 index 000000000..eb2b80b30 --- /dev/null +++ b/MixERP.Net.DatabaseLayer/Transactions/DirectSales.cs @@ -0,0 +1,240 @@ +/******************************************************************************** +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.Data; +using System.Linq; +using System.Text; +using Npgsql; + +namespace MixERP.Net.DatabaseLayer.Transactions +{ + public static class DirectSales + { + + [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + public static long Add(DateTime valueDate, int officeId, int userId, long logOnId, int costCenterId, string referenceNumber, string statementReference, MixERP.Net.Common.Models.Transactions.StockMasterModel stockMaster, Collection details) + { + if(stockMaster == null) + { + return 0; + } + + if(details == null) + { + return 0; + } + + if(details.Count.Equals(0)) + { + return 0; + } + + string sql = string.Empty; + long transactionMasterId = 0; + long stockMasterId = 0; + + decimal total = details.Sum(d => (d.Price * d.Quantity)); + decimal discountTotal = details.Sum(d => d.Discount); + decimal taxTotal = details.Sum(d => d.Tax); + + string creditInvariantParameter = "Sales.Receivables"; + string salesInvariantParameter = "Sales"; + string salesTaxInvariantParamter = "Sales.Tax"; + string salesDiscountInvariantParameter = "Sales.Discount"; + + + using(NpgsqlConnection connection = new NpgsqlConnection(DBFactory.DBConnection.ConnectionString())) + { + connection.Open(); + + using(NpgsqlTransaction transaction = connection.BeginTransaction()) + { + try + { + + #region TransactionMaster + sql = "INSERT INTO transactions.transaction_master(transaction_master_id, transaction_counter, transaction_code, book, value_date, user_id, login_id, office_id, cost_center_id, reference_number, statement_reference) SELECT nextval(pg_get_serial_sequence('transactions.transaction_master', 'transaction_master_id')), transactions.get_new_transaction_counter(@ValueDate), transactions.get_transaction_code(@ValueDate, @OfficeId, @UserId, @LogOnId), @Book, @ValueDate, @UserId, @LogOnId, @OfficeId, @CostCenterId, @ReferenceNumber, @StatementReference;SELECT currval(pg_get_serial_sequence('transactions.transaction_master', 'transaction_master_id'));"; + using(NpgsqlCommand tm = new NpgsqlCommand(sql, connection)) + { + tm.Parameters.AddWithValue("@ValueDate", valueDate); + tm.Parameters.AddWithValue("@OfficeId", officeId); + tm.Parameters.AddWithValue("@UserId", userId); + tm.Parameters.AddWithValue("@LogOnId", logOnId); + tm.Parameters.AddWithValue("@Book", "Sales.Direct"); + tm.Parameters.AddWithValue("@CostCenterId", costCenterId); + tm.Parameters.AddWithValue("@ReferenceNumber", referenceNumber); + tm.Parameters.AddWithValue("@StatementReference", statementReference); + + transactionMasterId = MixERP.Net.Common.Conversion.TryCastLong(tm.ExecuteScalar()); + } + + #region TransactionDetails + sql = "INSERT INTO transactions.transaction_details(transaction_master_id, tran_type, account_id, statement_reference, cash_repository_id, amount) SELECT @TransactionMasterId, @TranType, core.get_account_id_by_parameter(@ParameterName), @StatementReference, @CashRepositoryId, @Amount;"; + + using(NpgsqlCommand salesRow = new NpgsqlCommand(sql, connection)) + { + salesRow.Parameters.AddWithValue("@TransactionMasterId", transactionMasterId); + salesRow.Parameters.AddWithValue("@TranType", "Cr"); + salesRow.Parameters.AddWithValue("@ParameterName", salesInvariantParameter); + salesRow.Parameters.AddWithValue("@StatementReference", statementReference); + salesRow.Parameters.AddWithValue("@CashRepositoryId", DBNull.Value); + salesRow.Parameters.AddWithValue("@Amount", total); + + salesRow.ExecuteNonQuery(); + } + + if(taxTotal > 0) + { + using(NpgsqlCommand taxRow = new NpgsqlCommand(sql, connection)) + { + taxRow.Parameters.AddWithValue("@TransactionMasterId", transactionMasterId); + taxRow.Parameters.AddWithValue("@TranType", "Cr"); + taxRow.Parameters.AddWithValue("@ParameterName", salesTaxInvariantParamter); + taxRow.Parameters.AddWithValue("@StatementReference", statementReference); + taxRow.Parameters.AddWithValue("@CashRepositoryId", DBNull.Value); + taxRow.Parameters.AddWithValue("@Amount", taxTotal); + taxRow.ExecuteNonQuery(); + } + } + + if(discountTotal > 0) + { + using(NpgsqlCommand discountRow = new NpgsqlCommand(sql, connection)) + { + discountRow.Parameters.AddWithValue("@TransactionMasterId", transactionMasterId); + discountRow.Parameters.AddWithValue("@TranType", "Dr"); + discountRow.Parameters.AddWithValue("@ParameterName", salesDiscountInvariantParameter); + discountRow.Parameters.AddWithValue("@StatementReference", statementReference); + discountRow.Parameters.AddWithValue("@CashRepositoryId", DBNull.Value); + discountRow.Parameters.AddWithValue("@Amount", discountTotal); + discountRow.ExecuteNonQuery(); + } + } + + if(stockMaster.IsCredit) + { + using(NpgsqlCommand creditRow = new NpgsqlCommand(sql, connection)) + { + creditRow.Parameters.AddWithValue("@TransactionMasterId", transactionMasterId); + creditRow.Parameters.AddWithValue("@TranType", "Dr"); + creditRow.Parameters.AddWithValue("@ParameterName", creditInvariantParameter); + creditRow.Parameters.AddWithValue("@StatementReference", statementReference); + creditRow.Parameters.AddWithValue("@CashRepositoryId", DBNull.Value); + creditRow.Parameters.AddWithValue("@Amount", total - discountTotal + taxTotal + stockMaster.ShippingCharge); + creditRow.ExecuteNonQuery(); + } + } + else + { + sql = "INSERT INTO transactions.transaction_details(transaction_master_id, tran_type, account_id, statement_reference, cash_repository_id, amount) SELECT @TransactionMasterId, @TranType, core.get_cash_account_id(), @StatementReference, @CashRepositoryId, @Amount;"; + using(NpgsqlCommand cashRow = new NpgsqlCommand(sql, connection)) + { + cashRow.Parameters.AddWithValue("@TransactionMasterId", transactionMasterId); + cashRow.Parameters.AddWithValue("@TranType", "Dr"); + cashRow.Parameters.AddWithValue("@StatementReference", statementReference); + cashRow.Parameters.AddWithValue("@CashRepositoryId", stockMaster.CashRepositoryId); + cashRow.Parameters.AddWithValue("@Amount", total - discountTotal + taxTotal + stockMaster.ShippingCharge); + cashRow.ExecuteNonQuery(); + } + } + + if(stockMaster.ShippingCharge > 0) + { + sql = "INSERT INTO transactions.transaction_details(transaction_master_id, tran_type, account_id, statement_reference, cash_repository_id, amount) SELECT @TransactionMasterId, @TranType, core.get_account_id_by_shipper_id(@ShipperId), @StatementReference, @CashRepositoryId, @Amount;"; + + using(NpgsqlCommand shippingChargeRow = new NpgsqlCommand(sql, connection)) + { + shippingChargeRow.Parameters.AddWithValue("@TransactionMasterId", transactionMasterId); + shippingChargeRow.Parameters.AddWithValue("@TranType", "Cr"); + shippingChargeRow.Parameters.AddWithValue("@ShipperId", stockMaster.ShipperId); + shippingChargeRow.Parameters.AddWithValue("@StatementReference", statementReference); + shippingChargeRow.Parameters.AddWithValue("@CashRepositoryId", DBNull.Value); + shippingChargeRow.Parameters.AddWithValue("@Amount", stockMaster.ShippingCharge); + + shippingChargeRow.ExecuteNonQuery(); + } + } + #endregion + #endregion + + #region StockMaster + + sql = "INSERT INTO transactions.stock_master(stock_master_id, transaction_master_id, party_id, agent_id, price_type_id, is_credit, shipper_id, shipping_address_id, shipping_charge, store_id, cash_repository_id) SELECT nextval(pg_get_serial_sequence('transactions.stock_master', 'stock_master_id')), @TransactionMasterId, core.get_party_id_by_party_code(@PartyCode), @AgentId, @PriceTypeId, @IsCredit, @ShipperId, core.get_shipping_address_id_by_shipping_address_code(@ShippingAddressCode), @ShippingCharge, @StoreId, @CashRepositoryId; SELECT currval(pg_get_serial_sequence('transactions.stock_master', 'stock_master_id'));"; + + using(NpgsqlCommand stockMasterRow = new NpgsqlCommand(sql, connection)) + { + stockMasterRow.Parameters.AddWithValue("@TransactionMasterId", transactionMasterId); + stockMasterRow.Parameters.AddWithValue("@PartyCode", stockMaster.PartyCode); + stockMasterRow.Parameters.AddWithValue("@AgentId", stockMaster.AgentId); + + stockMasterRow.Parameters.AddWithValue("@PriceTypeId", stockMaster.PriceTypeId); + stockMasterRow.Parameters.AddWithValue("@IsCredit", stockMaster.IsCredit); + + if(stockMaster.ShipperId.Equals(0)) + { + stockMasterRow.Parameters.AddWithValue("@ShipperId", DBNull.Value); + } + else + { + stockMasterRow.Parameters.AddWithValue("@ShipperId", stockMaster.ShipperId); + } + + stockMasterRow.Parameters.AddWithValue("@ShippingAddressCode", stockMaster.ShippingAddressCode); + stockMasterRow.Parameters.AddWithValue("@ShippingCharge", stockMaster.ShippingCharge); + stockMasterRow.Parameters.AddWithValue("@StoreId", stockMaster.StoreId); + stockMasterRow.Parameters.AddWithValue("@CashRepositoryId", stockMaster.CashRepositoryId); + + stockMasterId = MixERP.Net.Common.Conversion.TryCastLong(stockMasterRow.ExecuteScalar()); + } + + #region StockDetails + sql = @"INSERT INTO + transactions.stock_details(stock_master_id, tran_type, store_id, item_id, quantity, unit_id, base_quantity, base_unit_id, price, discount, tax_rate, tax) + SELECT @StockMasterId, @TranType, @StoreId, core.get_item_id_by_item_code(@ItemCode), @Quantity, core.get_unit_id_by_unit_name(@UnitName), core.get_base_quantity_by_unit_name(@UnitName, @Quantity), core.get_base_unit_id_by_unit_name(@UnitName), @Price, @Discount, @TaxRate, @Tax;"; + + foreach(MixERP.Net.Common.Models.Transactions.StockMasterDetailModel model in details) + { + using(NpgsqlCommand stockMasterDetailRow = new NpgsqlCommand(sql, connection)) + { + stockMasterDetailRow.Parameters.AddWithValue("@StockMasterId", stockMasterId); + stockMasterDetailRow.Parameters.AddWithValue("@TranType", "Cr"); + stockMasterDetailRow.Parameters.AddWithValue("@StoreId", model.StoreId); + stockMasterDetailRow.Parameters.AddWithValue("@ItemCode", model.ItemCode); + stockMasterDetailRow.Parameters.AddWithValue("@Quantity", model.Quantity); + stockMasterDetailRow.Parameters.AddWithValue("@UnitName", model.UnitName); + stockMasterDetailRow.Parameters.AddWithValue("@Price", model.Price); + stockMasterDetailRow.Parameters.AddWithValue("@Discount", model.Discount); + stockMasterDetailRow.Parameters.AddWithValue("@TaxRate", model.TaxRate); + stockMasterDetailRow.Parameters.AddWithValue("@Tax", model.Tax); + + stockMasterDetailRow.ExecuteNonQuery(); + } + } + + #endregion + + #endregion + + transaction.Commit(); + return transactionMasterId; + } + catch(NpgsqlException) + { + transaction.Rollback(); + throw; + } + } + + return 0; + } + } + + } +} diff --git a/MixERP.Net.DatabaseLayer/Transactions/NonGlStockTransaction.cs b/MixERP.Net.DatabaseLayer/Transactions/NonGlStockTransaction.cs new file mode 100644 index 000000000..9f0c6c921 --- /dev/null +++ b/MixERP.Net.DatabaseLayer/Transactions/NonGlStockTransaction.cs @@ -0,0 +1,166 @@ +/******************************************************************************** +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.Text; +using Npgsql; + +namespace MixERP.Net.DatabaseLayer.Transactions +{ + public static class NonGLStockTransaction + { + [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + public static long Add(string book, DateTime valueDate, int officeId, int userId, long logOnId, string referenceNumber, string statementReference, MixERP.Net.Common.Models.Transactions.StockMasterModel stockMaster, Collection details) + { + if(stockMaster == null) + { + return 0; + } + + if(details == null) + { + return 0; + } + + if(details.Count.Equals(0)) + { + return 0; + } + + string sql = string.Empty; + long nonGlStockMasterId = 0; + + //decimal total = details.Sum(d => (d.Price * d.Quantity)); + //decimal discountTotal = details.Sum(d => d.Discount); + //decimal taxTotal = details.Sum(d => d.Tax); + + using(NpgsqlConnection connection = new NpgsqlConnection(DBFactory.DBConnection.ConnectionString())) + { + connection.Open(); + + using(NpgsqlTransaction transaction = connection.BeginTransaction()) + { + try + { + + #region NonGLStockMaster + sql = "INSERT INTO transactions.non_gl_stock_master(non_gl_stock_master_id, value_date, book, party_id, price_type_id, login_id, user_id, office_id, reference_number, statement_reference) SELECT nextval(pg_get_serial_sequence('transactions.non_gl_stock_master', 'non_gl_stock_master_id')), @ValueDate, @Book, core.get_party_id_by_party_code(@PartyCode), @PriceTypeId, @LoginId, @UserId, @OfficeId, @ReferenceNumber, @StatementReference; SELECT currval(pg_get_serial_sequence('transactions.non_gl_stock_master', 'non_gl_stock_master_id'));"; + + using(NpgsqlCommand stockMasterRow = new NpgsqlCommand(sql, connection)) + { + stockMasterRow.Parameters.AddWithValue("@ValueDate", valueDate); + stockMasterRow.Parameters.AddWithValue("@Book", book); + stockMasterRow.Parameters.AddWithValue("@PartyCode", stockMaster.PartyCode); + + if(stockMaster.PriceTypeId.Equals(0)) + { + stockMasterRow.Parameters.AddWithValue("@PriceTypeId", DBNull.Value); + } + else + { + stockMasterRow.Parameters.AddWithValue("@PriceTypeId", stockMaster.PriceTypeId); + } + + stockMasterRow.Parameters.AddWithValue("@LoginId", logOnId); + stockMasterRow.Parameters.AddWithValue("@UserId", userId); + stockMasterRow.Parameters.AddWithValue("@OfficeId", officeId); + stockMasterRow.Parameters.AddWithValue("@ReferenceNumber", referenceNumber); + + stockMasterRow.Parameters.AddWithValue("@StatementReference", statementReference); + + nonGlStockMasterId = MixERP.Net.Common.Conversion.TryCastLong(stockMasterRow.ExecuteScalar()); + } + + #region NonGLStockDetails + sql = @"INSERT INTO + transactions.non_gl_stock_details(non_gl_stock_master_id, item_id, quantity, unit_id, base_quantity, base_unit_id, price, discount, tax_rate, tax) + SELECT @NonGlStockMasterId, core.get_item_id_by_item_code(@ItemCode), @Quantity, core.get_unit_id_by_unit_name(@UnitName), core.get_base_quantity_by_unit_name(@UnitName, @Quantity), core.get_base_unit_id_by_unit_name(@UnitName), @Price, @Discount, @TaxRate, @Tax;"; + + foreach(MixERP.Net.Common.Models.Transactions.StockMasterDetailModel model in details) + { + using(NpgsqlCommand stockMasterDetailRow = new NpgsqlCommand(sql, connection)) + { + stockMasterDetailRow.Parameters.AddWithValue("@NonGlStockMasterId", nonGlStockMasterId); + stockMasterDetailRow.Parameters.AddWithValue("@ItemCode", model.ItemCode); + stockMasterDetailRow.Parameters.AddWithValue("@Quantity", model.Quantity); + stockMasterDetailRow.Parameters.AddWithValue("@UnitName", model.UnitName); + stockMasterDetailRow.Parameters.AddWithValue("@Price", model.Price); + stockMasterDetailRow.Parameters.AddWithValue("@Discount", model.Discount); + stockMasterDetailRow.Parameters.AddWithValue("@TaxRate", model.TaxRate); + stockMasterDetailRow.Parameters.AddWithValue("@Tax", model.Tax); + + stockMasterDetailRow.ExecuteNonQuery(); + } + } + + #endregion + + #endregion + + transaction.Commit(); + return nonGlStockMasterId; + } + catch(NpgsqlException) + { + transaction.Rollback(); + throw; + } + } + + return 0; + } + } + + public static System.Data.DataTable GetView(int officeId, string book) + { + string sql = @"WITH RECURSIVE office_cte(office_id) AS + ( + SELECT @OfficeId + UNION ALL + SELECT + c.office_id + FROM + office_cte AS p, + office.offices AS c + WHERE + parent_office_id = p.office_id + ) + SELECT + transactions.non_gl_stock_master.non_gl_stock_master_id AS id, + transactions.non_gl_stock_master.value_date, + office.offices.office_code AS office, + core.parties.party_code || ' (' || core.parties.party_name || ')' AS party, + core.price_types.price_type_code || ' (' || core.price_types.price_type_name || ')' AS price_type, + transactions.non_gl_stock_master.transaction_ts, + office.users.user_name AS user, + transactions.non_gl_stock_master.reference_number, + transactions.non_gl_stock_master.statement_reference + FROM transactions.non_gl_stock_master + INNER JOIN core.parties + ON transactions.non_gl_stock_master.party_id = core.parties.party_id + INNER JOIN core.price_types + ON transactions.non_gl_stock_master.price_type_id = core.price_types.price_type_id + INNER JOIN office.users + ON transactions.non_gl_stock_master.user_id = office.users.user_id + INNER JOIN office.offices + ON transactions.non_gl_stock_master.office_id = office.offices.office_id + WHERE transactions.non_gl_stock_master.book = @Book + AND office.offices.office_id IN (SELECT office_id FROM office_cte);"; + + using(NpgsqlCommand command = new NpgsqlCommand(sql)) + { + command.Parameters.AddWithValue("@OfficeId", officeId); + command.Parameters.AddWithValue("@Book", book); + + return MixERP.Net.DatabaseLayer.DBFactory.DBOperations.GetDataTable(command); + } + } + } +} diff --git a/MixERP.Net.DatabaseLayer/Transactions/SalesDelivery.cs b/MixERP.Net.DatabaseLayer/Transactions/SalesDelivery.cs new file mode 100644 index 000000000..a5da66ca8 --- /dev/null +++ b/MixERP.Net.DatabaseLayer/Transactions/SalesDelivery.cs @@ -0,0 +1,217 @@ +/******************************************************************************** +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.Data; +using System.Linq; +using System.Text; +using Npgsql; + +namespace MixERP.Net.DatabaseLayer.Transactions +{ + public static class SalesDelivery + { + + [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + public static long Add(DateTime valueDate, int officeId, int userId, long logOnId, int costCenterId, string referenceNumber, string statementReference, MixERP.Net.Common.Models.Transactions.StockMasterModel stockMaster, Collection details) + { + if(stockMaster == null) + { + return 0; + } + + if(details == null) + { + return 0; + } + + if(details.Count.Equals(0)) + { + return 0; + } + + string sql = string.Empty; + long transactionMasterId = 0; + long stockMasterId = 0; + + decimal total = details.Sum(d => (d.Price * d.Quantity)); + decimal discountTotal = details.Sum(d => d.Discount); + decimal taxTotal = details.Sum(d => d.Tax); + + string creditInvariantParameter = "Sales.Receivables"; + string salesInvariantParameter = "Sales"; + string salesTaxInvariantParamter = "Sales.Tax"; + string salesDiscountInvariantParameter = "Sales.Discount"; + + + using(NpgsqlConnection connection = new NpgsqlConnection(DBFactory.DBConnection.ConnectionString())) + { + connection.Open(); + + using(NpgsqlTransaction transaction = connection.BeginTransaction()) + { + try + { + + #region TransactionMaster + sql = "INSERT INTO transactions.transaction_master(transaction_master_id, transaction_counter, transaction_code, book, value_date, user_id, login_id, office_id, cost_center_id, reference_number, statement_reference) SELECT nextval(pg_get_serial_sequence('transactions.transaction_master', 'transaction_master_id')), transactions.get_new_transaction_counter(@ValueDate), transactions.get_transaction_code(@ValueDate, @OfficeId, @UserId, @LogOnId), @Book, @ValueDate, @UserId, @LogOnId, @OfficeId, @CostCenterId, @ReferenceNumber, @StatementReference;SELECT currval(pg_get_serial_sequence('transactions.transaction_master', 'transaction_master_id'));"; + using(NpgsqlCommand tm = new NpgsqlCommand(sql, connection)) + { + tm.Parameters.AddWithValue("@ValueDate", valueDate); + tm.Parameters.AddWithValue("@OfficeId", officeId); + tm.Parameters.AddWithValue("@UserId", userId); + tm.Parameters.AddWithValue("@LogOnId", logOnId); + tm.Parameters.AddWithValue("@Book", "Sales.Delivery"); + tm.Parameters.AddWithValue("@CostCenterId", costCenterId); + tm.Parameters.AddWithValue("@ReferenceNumber", referenceNumber); + tm.Parameters.AddWithValue("@StatementReference", statementReference); + + transactionMasterId = MixERP.Net.Common.Conversion.TryCastLong(tm.ExecuteScalar()); + } + + #region TransactionDetails + sql = "INSERT INTO transactions.transaction_details(transaction_master_id, tran_type, account_id, statement_reference, amount) SELECT @TransactionMasterId, @TranType, core.get_account_id_by_parameter(@ParameterName), @StatementReference, @Amount;"; + + using(NpgsqlCommand salesRow = new NpgsqlCommand(sql, connection)) + { + salesRow.Parameters.AddWithValue("@TransactionMasterId", transactionMasterId); + salesRow.Parameters.AddWithValue("@TranType", "Cr"); + salesRow.Parameters.AddWithValue("@ParameterName", salesInvariantParameter); + salesRow.Parameters.AddWithValue("@StatementReference", statementReference); + salesRow.Parameters.AddWithValue("@Amount", total); + + salesRow.ExecuteNonQuery(); + } + + if(taxTotal > 0) + { + using(NpgsqlCommand taxRow = new NpgsqlCommand(sql, connection)) + { + taxRow.Parameters.AddWithValue("@TransactionMasterId", transactionMasterId); + taxRow.Parameters.AddWithValue("@TranType", "Cr"); + taxRow.Parameters.AddWithValue("@ParameterName", salesTaxInvariantParamter); + taxRow.Parameters.AddWithValue("@StatementReference", statementReference); + taxRow.Parameters.AddWithValue("@Amount", taxTotal); + taxRow.ExecuteNonQuery(); + } + } + + if(discountTotal > 0) + { + using(NpgsqlCommand discountRow = new NpgsqlCommand(sql, connection)) + { + discountRow.Parameters.AddWithValue("@TransactionMasterId", transactionMasterId); + discountRow.Parameters.AddWithValue("@TranType", "Dr"); + discountRow.Parameters.AddWithValue("@ParameterName", salesDiscountInvariantParameter); + discountRow.Parameters.AddWithValue("@StatementReference", statementReference); + discountRow.Parameters.AddWithValue("@Amount", discountTotal); + discountRow.ExecuteNonQuery(); + } + } + + using(NpgsqlCommand creditRow = new NpgsqlCommand(sql, connection)) + { + creditRow.Parameters.AddWithValue("@TransactionMasterId", transactionMasterId); + creditRow.Parameters.AddWithValue("@TranType", "Dr"); + creditRow.Parameters.AddWithValue("@ParameterName", creditInvariantParameter); + creditRow.Parameters.AddWithValue("@StatementReference", statementReference); + creditRow.Parameters.AddWithValue("@Amount", total - discountTotal + taxTotal + stockMaster.ShippingCharge); + creditRow.ExecuteNonQuery(); + } + + if(stockMaster.ShippingCharge > 0) + { + sql = "INSERT INTO transactions.transaction_details(transaction_master_id, tran_type, account_id, statement_reference, amount) SELECT @TransactionMasterId, @TranType, core.get_account_id_by_shipper_id(@ShipperId), @StatementReference, @Amount;"; + + using(NpgsqlCommand shippingChargeRow = new NpgsqlCommand(sql, connection)) + { + shippingChargeRow.Parameters.AddWithValue("@TransactionMasterId", transactionMasterId); + shippingChargeRow.Parameters.AddWithValue("@TranType", "Cr"); + shippingChargeRow.Parameters.AddWithValue("@ShipperId", stockMaster.ShipperId); + shippingChargeRow.Parameters.AddWithValue("@StatementReference", statementReference); + shippingChargeRow.Parameters.AddWithValue("@Amount", stockMaster.ShippingCharge); + + shippingChargeRow.ExecuteNonQuery(); + } + } + #endregion + #endregion + + #region StockMaster + + sql = "INSERT INTO transactions.stock_master(stock_master_id, transaction_master_id, party_id, agent_id, price_type_id, is_credit, shipper_id, shipping_charge, store_id) SELECT nextval(pg_get_serial_sequence('transactions.stock_master', 'stock_master_id')), @TransactionMasterId, core.get_party_id_by_party_code(@PartyCode), @AgentId, @PriceTypeId, @IsCredit, @ShipperId, @ShippingCharge, @StoreId; SELECT currval(pg_get_serial_sequence('transactions.stock_master', 'stock_master_id'));"; + + using(NpgsqlCommand stockMasterRow = new NpgsqlCommand(sql, connection)) + { + stockMasterRow.Parameters.AddWithValue("@TransactionMasterId", transactionMasterId); + stockMasterRow.Parameters.AddWithValue("@PartyCode", stockMaster.PartyCode); + stockMasterRow.Parameters.AddWithValue("@AgentId", stockMaster.AgentId); + stockMasterRow.Parameters.AddWithValue("@PriceTypeId", stockMaster.PriceTypeId); + stockMasterRow.Parameters.AddWithValue("@IsCredit", true); + + if(stockMaster.ShipperId.Equals(0)) + { + stockMasterRow.Parameters.AddWithValue("@ShipperId", DBNull.Value); + } + else + { + stockMasterRow.Parameters.AddWithValue("@ShipperId", stockMaster.ShipperId); + } + + stockMasterRow.Parameters.AddWithValue("@ShippingCharge", stockMaster.ShippingCharge); + + stockMasterRow.Parameters.AddWithValue("@StoreId", stockMaster.StoreId); + + stockMasterId = MixERP.Net.Common.Conversion.TryCastLong(stockMasterRow.ExecuteScalar()); + } + + #region StockDetails + sql = @"INSERT INTO + transactions.stock_details(stock_master_id, tran_type, store_id, item_id, quantity, unit_id, base_quantity, base_unit_id, price, discount, tax_rate, tax) + SELECT @StockMasterId, @TranType, @StoreId, core.get_item_id_by_item_code(@ItemCode), @Quantity, core.get_unit_id_by_unit_name(@UnitName), core.get_base_quantity_by_unit_name(@UnitName, @Quantity), core.get_base_unit_id_by_unit_name(@UnitName), @Price, @Discount, @TaxRate, @Tax;"; + + foreach(MixERP.Net.Common.Models.Transactions.StockMasterDetailModel model in details) + { + using(NpgsqlCommand stockMasterDetailRow = new NpgsqlCommand(sql, connection)) + { + stockMasterDetailRow.Parameters.AddWithValue("@StockMasterId", stockMasterId); + stockMasterDetailRow.Parameters.AddWithValue("@TranType", "Cr"); + stockMasterDetailRow.Parameters.AddWithValue("@StoreId", model.StoreId); + stockMasterDetailRow.Parameters.AddWithValue("@ItemCode", model.ItemCode); + stockMasterDetailRow.Parameters.AddWithValue("@Quantity", model.Quantity); + stockMasterDetailRow.Parameters.AddWithValue("@UnitName", model.UnitName); + stockMasterDetailRow.Parameters.AddWithValue("@Price", model.Price); + stockMasterDetailRow.Parameters.AddWithValue("@Discount", model.Discount); + stockMasterDetailRow.Parameters.AddWithValue("@TaxRate", model.TaxRate); + stockMasterDetailRow.Parameters.AddWithValue("@Tax", model.Tax); + + stockMasterDetailRow.ExecuteNonQuery(); + } + } + + #endregion + + #endregion + + transaction.Commit(); + return transactionMasterId; + } + catch(NpgsqlException) + { + transaction.Rollback(); + throw; + } + } + + return 0; + } + } + + } +} diff --git a/MixERP.Net.DatabaseLayer/Transactions/Transaction.cs b/MixERP.Net.DatabaseLayer/Transactions/Transaction.cs new file mode 100644 index 000000000..91c8ef86c --- /dev/null +++ b/MixERP.Net.DatabaseLayer/Transactions/Transaction.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.Collections.ObjectModel; +using System.Linq; +using System.Text; +using Npgsql; + +namespace MixERP.Net.DatabaseLayer.Transactions +{ + public static class Transaction + { + public static long Add(DateTime valueDate, int officeId, int userId, long logOnId, int costCenterId, string referenceNumber, Collection details) + { + if(details == null) + { + return 0; + } + + if(details.Count.Equals(0)) + { + return 0; + } + + string sql = string.Empty; + long transactionMasterId = 0; + + decimal debitTotal = details.Sum(d => (d.Debit)); + decimal creditTotal = details.Sum(d => (d.Credit)); + string tranType = string.Empty; + decimal amount = 0; + + + if(debitTotal != creditTotal) + { + return 0; + } + + + using(NpgsqlConnection connection = new NpgsqlConnection(DBFactory.DBConnection.ConnectionString())) + { + connection.Open(); + + using(NpgsqlTransaction transaction = connection.BeginTransaction()) + { + try + { + + sql = "INSERT INTO transactions.transaction_master(transaction_master_id, transaction_counter, transaction_code, book, value_date, user_id, login_id, office_id, cost_center_id, reference_number) SELECT nextval(pg_get_serial_sequence('transactions.transaction_master', 'transaction_master_id')), transactions.get_new_transaction_counter(@ValueDate), transactions.get_transaction_code(@ValueDate, @OfficeId, @UserId, @LogOnId), @Book, @ValueDate, @UserId, @LogOnId, @OfficeId, @CostCenterId, @ReferenceNumber;SELECT currval(pg_get_serial_sequence('transactions.transaction_master', 'transaction_master_id'));"; + using(NpgsqlCommand master = new NpgsqlCommand(sql, connection)) + { + master.Parameters.AddWithValue("@ValueDate", valueDate); + master.Parameters.AddWithValue("@OfficeId", officeId); + master.Parameters.AddWithValue("@UserId", userId); + master.Parameters.AddWithValue("@LogOnId", logOnId); + master.Parameters.AddWithValue("@Book", "Journal"); + master.Parameters.AddWithValue("@CostCenterId", costCenterId); + master.Parameters.AddWithValue("@ReferenceNumber", referenceNumber); + + transactionMasterId = MixERP.Net.Common.Conversion.TryCastLong(master.ExecuteScalar()); + } + + foreach(MixERP.Net.Common.Models.Transactions.TransactionDetailModel model in details) + { + sql = "INSERT INTO transactions.transaction_details(transaction_master_id, tran_type, account_id, statement_reference, cash_repository_id, amount) SELECT @TransactionMasterId, @TranType, core.get_account_id_by_account_code(@AccountCode::text), @StatementReference, office.get_cash_repository_id_by_cash_repository_name(@CashRepositoryName::text), @Amount;"; + + if(model.Credit > 0 && model.Debit > 0) + { + throw new InvalidOperationException(MixERP.Net.Common.Helpers.LocalizationHelper.GetResourceString("Warnings", "BothSidesHaveValue")); + } + else + { + if(model.Credit.Equals(0) && model.Debit > 0) + { + tranType = "Dr"; + amount = model.Debit; + } + else + { + tranType = "Cr"; + amount = model.Credit; + } + + + using(NpgsqlCommand transactionDetail = new NpgsqlCommand(sql, connection)) + { + transactionDetail.Parameters.AddWithValue("@TransactionMasterId", transactionMasterId); + transactionDetail.Parameters.AddWithValue("@TranType", tranType); + transactionDetail.Parameters.AddWithValue("@AccountCode", model.AccountCode); + transactionDetail.Parameters.AddWithValue("@StatementReference", model.StatementReference); + transactionDetail.Parameters.AddWithValue("@CashRepositoryName", model.CashRepositoryName); + transactionDetail.Parameters.AddWithValue("@Amount", amount); + transactionDetail.ExecuteNonQuery(); + } + + } + + } + + transaction.Commit(); + return transactionMasterId; + } + catch(NpgsqlException) + { + transaction.Rollback(); + throw; + } + catch(InvalidOperationException) + { + transaction.Rollback(); + throw; + } + } + } + } + + } +} diff --git a/MixERP.Net.DatabaseLayer/Transactions/Verification.cs b/MixERP.Net.DatabaseLayer/Transactions/Verification.cs new file mode 100644 index 000000000..430b41726 --- /dev/null +++ b/MixERP.Net.DatabaseLayer/Transactions/Verification.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.Data; +using System.Linq; +using System.Text; +using Npgsql; + +namespace MixERP.Net.DatabaseLayer.Transactions +{ + public static class Verification + { + public static MixERP.Net.Common.Models.Transactions.VerificationModel GetVerificationStatus(long transactionMasterId) + { + MixERP.Net.Common.Models.Transactions.VerificationModel model = new MixERP.Net.Common.Models.Transactions.VerificationModel(); + string sql = "SELECT verification_status_id, office.get_user_name_by_user_id(verified_by_user_id) AS verified_by_user_name, verified_by_user_id, last_verified_on, verification_reason FROM transactions.transaction_master WHERE transaction_master_id=@TransactionMasterId;"; + + using(NpgsqlCommand command = new NpgsqlCommand(sql)) + { + command.Parameters.AddWithValue("@TransactionMasterId", transactionMasterId); + + using(DataTable table = MixERP.Net.DatabaseLayer.DBFactory.DBOperations.GetDataTable(command)) + { + if(table != null) + { + if(table.Rows.Count.Equals(1)) + { + DataRow row = table.Rows[0]; + + model.Verification = MixERP.Net.Common.Conversion.TryCastShort(row["verification_status_id"]); + model.VerifierUserId = MixERP.Net.Common.Conversion.TryCastInteger(row["verified_by_user_id"]); + model.VerifierName = MixERP.Net.Common.Conversion.TryCastString(row["verified_by_user_name"]); + model.VerifiedDate = MixERP.Net.Common.Conversion.TryCastDate(row["last_verified_on"]); + model.VerificationReason = MixERP.Net.Common.Conversion.TryCastString(row["verification_reason"]); + } + } + } + } + + + return model; + } + + public static bool WithdrawTransaction(long transactionMasterId, int userId, string reason) + { + short status = MixERP.Net.Common.Models.Transactions.VerificationDomain.GetVerification(MixERP.Net.Common.Models.Transactions.VerificationType.Withdrawn); + + string sql = "UPDATE transactions.transaction_master SET verification_status_id=@Status, verified_by_user_id=@UserId, verification_reason=@Reason WHERE transactions.transaction_master.transaction_master_id=@TransactionMasterId;"; + using(NpgsqlCommand command = new NpgsqlCommand(sql)) + { + command.Parameters.AddWithValue("@Status", status); + command.Parameters.AddWithValue("@UserId", userId); + command.Parameters.AddWithValue("@reason", reason); + command.Parameters.AddWithValue("@TransactionMasterId", transactionMasterId); + + return MixERP.Net.DatabaseLayer.DBFactory.DBOperations.ExecuteNonQuery(command); + } + } + + public static bool CallAutoVerification(long transactionMasterId) + { + if(MixERP.Net.Common.Helpers.Switches.EnableAutoVerification()) + { + string sql = "SELECT transactions.auto_verify(@TransactionMasterId::bigint);"; + using(NpgsqlCommand command = new NpgsqlCommand(sql)) + { + command.Parameters.AddWithValue("@TransactionMasterId", transactionMasterId); + return MixERP.Net.DatabaseLayer.DBFactory.DBOperations.ExecuteNonQuery(command); + } + } + + return false; + } + } +} diff --git a/MixERP.Net.FrontEnd/Account/ChangePassword.aspx b/MixERP.Net.FrontEnd/Account/ChangePassword.aspx new file mode 100644 index 000000000..6695ac574 --- /dev/null +++ b/MixERP.Net.FrontEnd/Account/ChangePassword.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="ChangePassword.aspx.cs" Inherits="MixERP.Net.FrontEnd.Account.ChangePassword" %> + + + + + + + + diff --git a/MixERP.Net.FrontEnd/Account/ChangePassword.aspx.cs b/MixERP.Net.FrontEnd/Account/ChangePassword.aspx.cs new file mode 100644 index 000000000..56e5a4f5b --- /dev/null +++ b/MixERP.Net.FrontEnd/Account/ChangePassword.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.Account +{ + public partial class ChangePassword : MixERP.Net.BusinessLayer.BasePageClass + { + protected void Page_Load(object sender, EventArgs e) + { + + } + } +} \ No newline at end of file diff --git a/MixERP.Net.FrontEnd/Account/ChangePassword.aspx.designer.cs b/MixERP.Net.FrontEnd/Account/ChangePassword.aspx.designer.cs new file mode 100644 index 000000000..1f9d29f68 --- /dev/null +++ b/MixERP.Net.FrontEnd/Account/ChangePassword.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.Account { + + + public partial class ChangePassword { + + protected System.Web.UI.WebControls.Content Content1; + } +} diff --git a/MixERP.Net.FrontEnd/Account/SignOut.aspx b/MixERP.Net.FrontEnd/Account/SignOut.aspx new file mode 100644 index 000000000..cd2016bbf --- /dev/null +++ b/MixERP.Net.FrontEnd/Account/SignOut.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="SignOut.aspx.cs" Inherits="MixERP.Net.FrontEnd.Account.SignOut" %> + + + + + + + + diff --git a/MixERP.Net.FrontEnd/Account/SignOut.aspx.cs b/MixERP.Net.FrontEnd/Account/SignOut.aspx.cs new file mode 100644 index 000000000..e2913ee72 --- /dev/null +++ b/MixERP.Net.FrontEnd/Account/SignOut.aspx.cs @@ -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/. +***********************************************************************************/ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Web; +using System.Web.Security; +using System.Web.UI; +using System.Web.UI.WebControls; + +namespace MixERP.Net.FrontEnd.Account +{ + public partial class SignOut : MixERP.Net.BusinessLayer.BasePageClass + { + protected void Page_Load(object sender, EventArgs e) + { + Session.Remove("UserName"); + FormsAuthentication.SignOut(); + Response.Redirect("~/SignIn.aspx"); + } + } +} \ No newline at end of file diff --git a/MixERP.Net.FrontEnd/Account/SignOut.aspx.designer.cs b/MixERP.Net.FrontEnd/Account/SignOut.aspx.designer.cs new file mode 100644 index 000000000..c2c2990db --- /dev/null +++ b/MixERP.Net.FrontEnd/Account/SignOut.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.Account { + + + public partial class SignOut { + + protected System.Web.UI.WebControls.Content Content1; + } +} diff --git a/MixERP.Net.FrontEnd/App_GlobalResources/FormResource.Designer.cs b/MixERP.Net.FrontEnd/App_GlobalResources/FormResource.Designer.cs new file mode 100644 index 000000000..fc9920303 --- /dev/null +++ b/MixERP.Net.FrontEnd/App_GlobalResources/FormResource.Designer.cs @@ -0,0 +1,2943 @@ +//------------------------------------------------------------------------------ +// +// 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 Resources { + using System; + + + /// + /// A strongly-typed resource class, for looking up localized strings, etc. + /// + // This class was auto-generated by the StronglyTypedResourceBuilder + // class via a tool like ResGen or Visual Studio. + // To add or remove a member, edit your .ResX file then rerun ResGen + // with the /str option or rebuild the Visual Studio project. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Web.Application.StronglyTypedResourceProxyBuilder", "11.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + internal class FormResource { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal FormResource() { + } + + /// + /// Returns the cached ResourceManager instance used by this class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Resources.ResourceManager ResourceManager { + get { + if (object.ReferenceEquals(resourceMan, null)) { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Resources.FormResource", global::System.Reflection.Assembly.Load("App_GlobalResources")); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Overrides the current thread's CurrentUICulture property for all + /// resource lookups using this strongly typed resource class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture { + get { + return resourceCulture; + } + set { + resourceCulture = value; + } + } + + /// + /// Looks up a localized string similar to Account Code. + /// + internal static string account_code { + get { + return ResourceManager.GetString("account_code", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Account Id. + /// + internal static string account_id { + get { + return ResourceManager.GetString("account_id", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Account Master Code. + /// + internal static string account_master_code { + get { + return ResourceManager.GetString("account_master_code", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Account Master Id. + /// + internal static string account_master_id { + get { + return ResourceManager.GetString("account_master_id", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Account Master Name. + /// + internal static string account_master_name { + get { + return ResourceManager.GetString("account_master_name", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Account Name. + /// + internal static string account_name { + get { + return ResourceManager.GetString("account_name", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Activity Id. + /// + internal static string activity_id { + get { + return ResourceManager.GetString("activity_id", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Address. + /// + internal static string address { + get { + return ResourceManager.GetString("address", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Address Line 1. + /// + internal static string address_line_1 { + get { + return ResourceManager.GetString("address_line_1", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Address Line 2. + /// + internal static string address_line_2 { + get { + return ResourceManager.GetString("address_line_2", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Ageing Slab Id. + /// + internal static string ageing_slab_id { + get { + return ResourceManager.GetString("ageing_slab_id", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Ageing Slab Name. + /// + internal static string ageing_slab_name { + get { + return ResourceManager.GetString("ageing_slab_name", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Agent Bonus Setup Id. + /// + internal static string agent_bonus_setup_id { + get { + return ResourceManager.GetString("agent_bonus_setup_id", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Agent Code. + /// + internal static string agent_code { + get { + return ResourceManager.GetString("agent_code", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Agent Id. + /// + internal static string agent_id { + get { + return ResourceManager.GetString("agent_id", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Agent Name. + /// + internal static string agent_name { + get { + return ResourceManager.GetString("agent_name", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Allow Credit. + /// + internal static string allow_credit { + get { + return ResourceManager.GetString("allow_credit", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Allow Sales. + /// + internal static string allow_sales { + get { + return ResourceManager.GetString("allow_sales", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Amount. + /// + internal static string amount { + get { + return ResourceManager.GetString("amount", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Amount From. + /// + internal static string amount_from { + get { + return ResourceManager.GetString("amount_from", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Amount To. + /// + internal static string amount_to { + get { + return ResourceManager.GetString("amount_to", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Analyze Count. + /// + internal static string analyze_count { + get { + return ResourceManager.GetString("analyze_count", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Assigned By User Id. + /// + internal static string assigned_by_user_id { + get { + return ResourceManager.GetString("assigned_by_user_id", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Audit Timestamp. + /// + internal static string audit_ts { + get { + return ResourceManager.GetString("audit_ts", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Audit User Id. + /// + internal static string audit_user_id { + get { + return ResourceManager.GetString("audit_user_id", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Autoanalyze Count. + /// + internal static string autoanalyze_count { + get { + return ResourceManager.GetString("autoanalyze_count", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Autovacuum Count. + /// + internal static string autovacuum_count { + get { + return ResourceManager.GetString("autovacuum_count", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Bank Account Code. + /// + internal static string bank_account_code { + get { + return ResourceManager.GetString("bank_account_code", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Bank Account Type. + /// + internal static string bank_account_type { + get { + return ResourceManager.GetString("bank_account_type", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Bank Address. + /// + internal static string bank_address { + get { + return ResourceManager.GetString("bank_address", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Bank Branch. + /// + internal static string bank_branch { + get { + return ResourceManager.GetString("bank_branch", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Bank Contact Number. + /// + internal static string bank_contact_number { + get { + return ResourceManager.GetString("bank_contact_number", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Bank Name. + /// + internal static string bank_name { + get { + return ResourceManager.GetString("bank_name", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Base Quantity. + /// + internal static string base_quantity { + get { + return ResourceManager.GetString("base_quantity", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Base Unit Id. + /// + internal static string base_unit_id { + get { + return ResourceManager.GetString("base_unit_id", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Base Unit Name. + /// + internal static string base_unit_name { + get { + return ResourceManager.GetString("base_unit_name", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Bonus Rate. + /// + internal static string bonus_rate { + get { + return ResourceManager.GetString("bonus_rate", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Bonus Slab Code. + /// + internal static string bonus_slab_code { + get { + return ResourceManager.GetString("bonus_slab_code", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Bonus Slab Detail Id. + /// + internal static string bonus_slab_detail_id { + get { + return ResourceManager.GetString("bonus_slab_detail_id", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Bonus Slab Id. + /// + internal static string bonus_slab_id { + get { + return ResourceManager.GetString("bonus_slab_id", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Bonus Slab Name. + /// + internal static string bonus_slab_name { + get { + return ResourceManager.GetString("bonus_slab_name", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Book. + /// + internal static string book { + get { + return ResourceManager.GetString("book", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Brand Code. + /// + internal static string brand_code { + get { + return ResourceManager.GetString("brand_code", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Brand Id. + /// + internal static string brand_id { + get { + return ResourceManager.GetString("brand_id", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Brand Name. + /// + internal static string brand_name { + get { + return ResourceManager.GetString("brand_name", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Browser. + /// + internal static string browser { + get { + return ResourceManager.GetString("browser", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Can Self Verify. + /// + internal static string can_self_verify { + get { + return ResourceManager.GetString("can_self_verify", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Can Verify GL Transactions. + /// + internal static string can_verify_gl_transactions { + get { + return ResourceManager.GetString("can_verify_gl_transactions", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Can Verify Purchase Transactions. + /// + internal static string can_verify_purchase_transactions { + get { + return ResourceManager.GetString("can_verify_purchase_transactions", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Can Verify Sales Transactions. + /// + internal static string can_verify_sales_transactions { + get { + return ResourceManager.GetString("can_verify_sales_transactions", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Cashier Id. + /// + internal static string cashier_id { + get { + return ResourceManager.GetString("cashier_id", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Cash Repository Code. + /// + internal static string cash_repository_code { + get { + return ResourceManager.GetString("cash_repository_code", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Cash Repository Id. + /// + internal static string cash_repository_id { + get { + return ResourceManager.GetString("cash_repository_id", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Cash Repository Name. + /// + internal static string cash_repository_name { + get { + return ResourceManager.GetString("cash_repository_name", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Cell. + /// + internal static string cell { + get { + return ResourceManager.GetString("cell", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Charge Interest. + /// + internal static string charge_interest { + get { + return ResourceManager.GetString("charge_interest", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Checking Frequency Id. + /// + internal static string checking_frequency_id { + get { + return ResourceManager.GetString("checking_frequency_id", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to City. + /// + internal static string city { + get { + return ResourceManager.GetString("city", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Closed. + /// + internal static string closed { + get { + return ResourceManager.GetString("closed", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Column Default. + /// + internal static string column_default { + get { + return ResourceManager.GetString("column_default", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Column Name. + /// + internal static string column_name { + get { + return ResourceManager.GetString("column_name", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Commission Rate. + /// + internal static string commission_rate { + get { + return ResourceManager.GetString("commission_rate", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Company Name. + /// + internal static string company_name { + get { + return ResourceManager.GetString("company_name", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Compare Unit Id. + /// + internal static string compare_unit_id { + get { + return ResourceManager.GetString("compare_unit_id", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Compare Unit Name. + /// + internal static string compare_unit_name { + get { + return ResourceManager.GetString("compare_unit_name", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Compound Unit Id. + /// + internal static string compound_unit_id { + get { + return ResourceManager.GetString("compound_unit_id", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Confidential. + /// + internal static string confidential { + get { + return ResourceManager.GetString("confidential", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Contact Cell. + /// + internal static string contact_cell { + get { + return ResourceManager.GetString("contact_cell", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Contact City. + /// + internal static string contact_city { + get { + return ResourceManager.GetString("contact_city", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Contact Country. + /// + internal static string contact_country { + get { + return ResourceManager.GetString("contact_country", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Contact Email. + /// + internal static string contact_email { + get { + return ResourceManager.GetString("contact_email", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Contact Number. + /// + internal static string contact_number { + get { + return ResourceManager.GetString("contact_number", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Contact Person. + /// + internal static string contact_person { + get { + return ResourceManager.GetString("contact_person", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Contact Phone. + /// + internal static string contact_phone { + get { + return ResourceManager.GetString("contact_phone", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Contact State. + /// + internal static string contact_state { + get { + return ResourceManager.GetString("contact_state", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Contact Street. + /// + internal static string contact_street { + get { + return ResourceManager.GetString("contact_street", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Cost Center Code. + /// + internal static string cost_center_code { + get { + return ResourceManager.GetString("cost_center_code", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Cost Center Id. + /// + internal static string cost_center_id { + get { + return ResourceManager.GetString("cost_center_id", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Cost Center Name. + /// + internal static string cost_center_name { + get { + return ResourceManager.GetString("cost_center_name", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Cost Price. + /// + internal static string cost_price { + get { + return ResourceManager.GetString("cost_price", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Cost Price Includes Tax. + /// + internal static string cost_price_includes_tax { + get { + return ResourceManager.GetString("cost_price_includes_tax", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Counter Code. + /// + internal static string counter_code { + get { + return ResourceManager.GetString("counter_code", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Counter Id. + /// + internal static string counter_id { + get { + return ResourceManager.GetString("counter_id", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Counter Name. + /// + internal static string counter_name { + get { + return ResourceManager.GetString("counter_name", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Country. + /// + internal static string country { + get { + return ResourceManager.GetString("country", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Credit. + /// + internal static string credit { + get { + return ResourceManager.GetString("credit", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to CST Number. + /// + internal static string cst_number { + get { + return ResourceManager.GetString("cst_number", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Currency Code. + /// + internal static string currency_code { + get { + return ResourceManager.GetString("currency_code", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Currency Name. + /// + internal static string currency_name { + get { + return ResourceManager.GetString("currency_name", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Currency Symbol. + /// + internal static string currency_symbol { + get { + return ResourceManager.GetString("currency_symbol", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Customer Code. + /// + internal static string customer_code { + get { + return ResourceManager.GetString("customer_code", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Customer Id. + /// + internal static string customer_id { + get { + return ResourceManager.GetString("customer_id", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Customer Name. + /// + internal static string customer_name { + get { + return ResourceManager.GetString("customer_name", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Data Type. + /// + internal static string data_type { + get { + return ResourceManager.GetString("data_type", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Datetime Precision. + /// + internal static string datetime_precision { + get { + return ResourceManager.GetString("datetime_precision", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Date Of Birth. + /// + internal static string date_of_birth { + get { + return ResourceManager.GetString("date_of_birth", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Debit. + /// + internal static string debit { + get { + return ResourceManager.GetString("debit", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Department Code. + /// + internal static string department_code { + get { + return ResourceManager.GetString("department_code", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Department Id. + /// + internal static string department_id { + get { + return ResourceManager.GetString("department_id", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Department Name. + /// + internal static string department_name { + get { + return ResourceManager.GetString("department_name", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Description. + /// + internal static string description { + get { + return ResourceManager.GetString("description", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Details. + /// + internal static string details { + get { + return ResourceManager.GetString("details", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Discount. + /// + internal static string discount { + get { + return ResourceManager.GetString("discount", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Domain Name. + /// + internal static string domain_name { + get { + return ResourceManager.GetString("domain_name", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Effective From. + /// + internal static string effective_from { + get { + return ResourceManager.GetString("effective_from", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Email. + /// + internal static string email { + get { + return ResourceManager.GetString("email", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Ends On. + /// + internal static string ends_on { + get { + return ResourceManager.GetString("ends_on", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Entry Timestamp. + /// + internal static string entry_ts { + get { + return ResourceManager.GetString("entry_ts", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Event Timestamp. + /// + internal static string event_ts { + get { + return ResourceManager.GetString("event_ts", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Exclude From Purchase. + /// + internal static string exclude_from_purchase { + get { + return ResourceManager.GetString("exclude_from_purchase", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Exclude From Sales. + /// + internal static string exclude_from_sales { + get { + return ResourceManager.GetString("exclude_from_sales", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to External Code. + /// + internal static string external_code { + get { + return ResourceManager.GetString("external_code", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Factory Address. + /// + internal static string factory_address { + get { + return ResourceManager.GetString("factory_address", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Failed Date Time. + /// + internal static string failed_date_time { + get { + return ResourceManager.GetString("failed_date_time", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Failed Login Id. + /// + internal static string failed_login_id { + get { + return ResourceManager.GetString("failed_login_id", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Fax. + /// + internal static string fax { + get { + return ResourceManager.GetString("fax", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to First Name. + /// + internal static string first_name { + get { + return ResourceManager.GetString("first_name", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Fiscal Year Code. + /// + internal static string fiscal_year_code { + get { + return ResourceManager.GetString("fiscal_year_code", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Fiscal Year Name. + /// + internal static string fiscal_year_name { + get { + return ResourceManager.GetString("fiscal_year_name", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Frequency Code. + /// + internal static string frequency_code { + get { + return ResourceManager.GetString("frequency_code", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Frequency Id. + /// + internal static string frequency_id { + get { + return ResourceManager.GetString("frequency_id", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Frequency Name. + /// + internal static string frequency_name { + get { + return ResourceManager.GetString("frequency_name", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Frequency Setup Id. + /// + internal static string frequency_setup_id { + get { + return ResourceManager.GetString("frequency_setup_id", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to From Days. + /// + internal static string from_days { + get { + return ResourceManager.GetString("from_days", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Full Name. + /// + internal static string full_name { + get { + return ResourceManager.GetString("full_name", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to GL Verification Limit. + /// + internal static string gl_verification_limit { + get { + return ResourceManager.GetString("gl_verification_limit", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Has Child. + /// + internal static string has_child { + get { + return ResourceManager.GetString("has_child", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Hot Item. + /// + internal static string hot_item { + get { + return ResourceManager.GetString("hot_item", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Hundredth Name. + /// + internal static string hundredth_name { + get { + return ResourceManager.GetString("hundredth_name", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Id. + /// + internal static string id { + get { + return ResourceManager.GetString("id", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Includes Tax. + /// + internal static string includes_tax { + get { + return ResourceManager.GetString("includes_tax", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Interest Compounding Frequency Id. + /// + internal static string interest_compounding_frequency_id { + get { + return ResourceManager.GetString("interest_compounding_frequency_id", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Interest Rate. + /// + internal static string interest_rate { + get { + return ResourceManager.GetString("interest_rate", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to IP Address. + /// + internal static string ip_address { + get { + return ResourceManager.GetString("ip_address", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Is Active. + /// + internal static string is_active { + get { + return ResourceManager.GetString("is_active", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Is Admin. + /// + internal static string is_admin { + get { + return ResourceManager.GetString("is_admin", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Is Cash. + /// + internal static string is_cash { + get { + return ResourceManager.GetString("is_cash", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Is Nullable. + /// + internal static string is_nullable { + get { + return ResourceManager.GetString("is_nullable", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Is Supplier. + /// + internal static string is_supplier { + get { + return ResourceManager.GetString("is_supplier", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Is System. + /// + internal static string is_system { + get { + return ResourceManager.GetString("is_system", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Item Code. + /// + internal static string item_code { + get { + return ResourceManager.GetString("item_code", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Item Cost Price Id. + /// + internal static string item_cost_price_id { + get { + return ResourceManager.GetString("item_cost_price_id", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Item Group Code. + /// + internal static string item_group_code { + get { + return ResourceManager.GetString("item_group_code", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Item Group Id. + /// + internal static string item_group_id { + get { + return ResourceManager.GetString("item_group_id", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Item Group Name. + /// + internal static string item_group_name { + get { + return ResourceManager.GetString("item_group_name", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Item Id. + /// + internal static string item_id { + get { + return ResourceManager.GetString("item_id", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Item Image. + /// + internal static string item_image { + get { + return ResourceManager.GetString("item_image", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Item Name. + /// + internal static string item_name { + get { + return ResourceManager.GetString("item_name", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Item Opening Inventory Id. + /// + internal static string item_opening_inventory_id { + get { + return ResourceManager.GetString("item_opening_inventory_id", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Item Selling Price Id. + /// + internal static string item_selling_price_id { + get { + return ResourceManager.GetString("item_selling_price_id", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Last Analaze. + /// + internal static string last_analyze { + get { + return ResourceManager.GetString("last_analyze", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Last Autoanalyze. + /// + internal static string last_autoanalyze { + get { + return ResourceManager.GetString("last_autoanalyze", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Last Autovacuum. + /// + internal static string last_autovacuum { + get { + return ResourceManager.GetString("last_autovacuum", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Last Name. + /// + internal static string last_name { + get { + return ResourceManager.GetString("last_name", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Last Vacuum. + /// + internal static string last_vacuum { + get { + return ResourceManager.GetString("last_vacuum", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Lead Source Code. + /// + internal static string lead_source_code { + get { + return ResourceManager.GetString("lead_source_code", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Lead Source Id. + /// + internal static string lead_source_id { + get { + return ResourceManager.GetString("lead_source_id", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Lead Source Name. + /// + internal static string lead_source_name { + get { + return ResourceManager.GetString("lead_source_name", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Lead Status Code. + /// + internal static string lead_status_code { + get { + return ResourceManager.GetString("lead_status_code", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Lead Status Id. + /// + internal static string lead_status_id { + get { + return ResourceManager.GetString("lead_status_id", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Lead Status Name. + /// + internal static string lead_status_name { + get { + return ResourceManager.GetString("lead_status_name", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Lead Time (In Days). + /// + internal static string lead_time_in_days { + get { + return ResourceManager.GetString("lead_time_in_days", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Level. + /// + internal static string level { + get { + return ResourceManager.GetString("level", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Lock Out Id. + /// + internal static string lock_out_id { + get { + return ResourceManager.GetString("lock_out_id", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Lock Out Till. + /// + internal static string lock_out_till { + get { + return ResourceManager.GetString("lock_out_till", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Lock Out Time. + /// + internal static string lock_out_time { + get { + return ResourceManager.GetString("lock_out_time", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Logged In Office. + /// + internal static string logged_in_office { + get { + return ResourceManager.GetString("logged_in_office", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Logged In Office Id. + /// + internal static string logged_in_office_id { + get { + return ResourceManager.GetString("logged_in_office_id", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Login Date Time. + /// + internal static string login_date_time { + get { + return ResourceManager.GetString("login_date_time", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Login Id. + /// + internal static string login_id { + get { + return ResourceManager.GetString("login_id", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Maintained By. + /// + internal static string maintained_by { + get { + return ResourceManager.GetString("maintained_by", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Maintained By User Id. + /// + internal static string maintained_by_user_id { + get { + return ResourceManager.GetString("maintained_by_user_id", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Maintain Stock. + /// + internal static string maintain_stock { + get { + return ResourceManager.GetString("maintain_stock", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Maximum Credit Amount. + /// + internal static string maximum_credit_amount { + get { + return ResourceManager.GetString("maximum_credit_amount", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Maximum Credit Period. + /// + internal static string maximum_credit_period { + get { + return ResourceManager.GetString("maximum_credit_period", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Menu Code. + /// + internal static string menu_code { + get { + return ResourceManager.GetString("menu_code", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Menu Id. + /// + internal static string menu_id { + get { + return ResourceManager.GetString("menu_id", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Menu Text. + /// + internal static string menu_text { + get { + return ResourceManager.GetString("menu_text", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Middle Name. + /// + internal static string middle_name { + get { + return ResourceManager.GetString("middle_name", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Minimum Credit. + /// + internal static string mimimum_credit_amount { + get { + return ResourceManager.GetString("mimimum_credit_amount", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to New Val. + /// + internal static string new_val { + get { + return ResourceManager.GetString("new_val", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Nick Name. + /// + internal static string nick_name { + get { + return ResourceManager.GetString("nick_name", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Numeric Precision. + /// + internal static string numeric_precision { + get { + return ResourceManager.GetString("numeric_precision", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Numeric Precision Radix. + /// + internal static string numeric_precision_radix { + get { + return ResourceManager.GetString("numeric_precision_radix", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Numeric Scale. + /// + internal static string numeric_scale { + get { + return ResourceManager.GetString("numeric_scale", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Office. + /// + internal static string office { + get { + return ResourceManager.GetString("office", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Office Address. + /// + internal static string office_address { + get { + return ResourceManager.GetString("office_address", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Office Code. + /// + internal static string office_code { + get { + return ResourceManager.GetString("office_code", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Office Id. + /// + internal static string office_id { + get { + return ResourceManager.GetString("office_id", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Office Name. + /// + internal static string office_name { + get { + return ResourceManager.GetString("office_name", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Old Val. + /// + internal static string old_val { + get { + return ResourceManager.GetString("old_val", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Opportunity Stage Code. + /// + internal static string opportunity_stage_code { + get { + return ResourceManager.GetString("opportunity_stage_code", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Opportunity Stage Id. + /// + internal static string opportunity_stage_id { + get { + return ResourceManager.GetString("opportunity_stage_id", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Opportunity Stage Name. + /// + internal static string opportunity_stage_name { + get { + return ResourceManager.GetString("opportunity_stage_name", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Ordinal Position. + /// + internal static string ordinal_position { + get { + return ResourceManager.GetString("ordinal_position", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to PAN Number. + /// + internal static string pan_number { + get { + return ResourceManager.GetString("pan_number", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Parent. + /// + internal static string parent { + get { + return ResourceManager.GetString("parent", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Parent Account Code. + /// + internal static string parent_account_code { + get { + return ResourceManager.GetString("parent_account_code", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Parent Account Id. + /// + internal static string parent_account_id { + get { + return ResourceManager.GetString("parent_account_id", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Parent Account Name. + /// + internal static string parent_account_name { + get { + return ResourceManager.GetString("parent_account_name", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Parent Cash Repository Id. + /// + internal static string parent_cash_repository_id { + get { + return ResourceManager.GetString("parent_cash_repository_id", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Parent Cr Code. + /// + internal static string parent_cr_code { + get { + return ResourceManager.GetString("parent_cr_code", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Parent Cr Name. + /// + internal static string parent_cr_name { + get { + return ResourceManager.GetString("parent_cr_name", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Parent Menu Id. + /// + internal static string parent_menu_id { + get { + return ResourceManager.GetString("parent_menu_id", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Parent Office Id. + /// + internal static string parent_office_id { + get { + return ResourceManager.GetString("parent_office_id", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Party. + /// + internal static string party { + get { + return ResourceManager.GetString("party", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Party Code. + /// + internal static string party_code { + get { + return ResourceManager.GetString("party_code", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Party Id. + /// + internal static string party_id { + get { + return ResourceManager.GetString("party_id", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Party Name. + /// + internal static string party_name { + get { + return ResourceManager.GetString("party_name", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Party Type. + /// + internal static string party_type { + get { + return ResourceManager.GetString("party_type", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Party Type Code. + /// + internal static string party_type_code { + get { + return ResourceManager.GetString("party_type_code", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Party Type Id. + /// + internal static string party_type_id { + get { + return ResourceManager.GetString("party_type_id", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Party Type Name. + /// + internal static string party_type_name { + get { + return ResourceManager.GetString("party_type_name", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Password. + /// + internal static string password { + get { + return ResourceManager.GetString("password", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Phone. + /// + internal static string phone { + get { + return ResourceManager.GetString("phone", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Preferred Supplier Id. + /// + internal static string preferred_supplier_id { + get { + return ResourceManager.GetString("preferred_supplier_id", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Price. + /// + internal static string price { + get { + return ResourceManager.GetString("price", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Price Type. + /// + internal static string price_type { + get { + return ResourceManager.GetString("price_type", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Price Type Code. + /// + internal static string price_type_code { + get { + return ResourceManager.GetString("price_type_code", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Price Type Id. + /// + internal static string price_type_id { + get { + return ResourceManager.GetString("price_type_id", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Price Type Name. + /// + internal static string price_type_name { + get { + return ResourceManager.GetString("price_type_name", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Primary Key Id. + /// + internal static string primary_key_id { + get { + return ResourceManager.GetString("primary_key_id", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Principal User. + /// + internal static string principal_user { + get { + return ResourceManager.GetString("principal_user", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Purchase Verification Limit. + /// + internal static string purchase_verification_limit { + get { + return ResourceManager.GetString("purchase_verification_limit", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Quantity. + /// + internal static string quantity { + get { + return ResourceManager.GetString("quantity", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Rate. + /// + internal static string rate { + get { + return ResourceManager.GetString("rate", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Rate Per Base Quantity. + /// + internal static string rate_per_base_quantity { + get { + return ResourceManager.GetString("rate_per_base_quantity", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Rate Per Quantity. + /// + internal static string rate_per_quantity { + get { + return ResourceManager.GetString("rate_per_quantity", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to References Field. + /// + internal static string references_field { + get { + return ResourceManager.GetString("references_field", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to References Schema. + /// + internal static string references_schema { + get { + return ResourceManager.GetString("references_schema", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to References Table. + /// + internal static string references_table { + get { + return ResourceManager.GetString("references_table", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Reference Number. + /// + internal static string reference_number { + get { + return ResourceManager.GetString("reference_number", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Ref No. + /// + internal static string ref_no { + get { + return ResourceManager.GetString("ref_no", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Registration Date. + /// + internal static string registration_date { + get { + return ResourceManager.GetString("registration_date", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Registration Number. + /// + internal static string registration_number { + get { + return ResourceManager.GetString("registration_number", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Relationship Officer Name. + /// + internal static string relationship_officer_name { + get { + return ResourceManager.GetString("relationship_officer_name", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Relation Officer. + /// + internal static string relation_officer { + get { + return ResourceManager.GetString("relation_officer", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Relation Name. + /// + internal static string relname { + get { + return ResourceManager.GetString("relname", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Remote User. + /// + internal static string remote_user { + get { + return ResourceManager.GetString("remote_user", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Reorder Level. + /// + internal static string reorder_level { + get { + return ResourceManager.GetString("reorder_level", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Repository. + /// + internal static string repository { + get { + return ResourceManager.GetString("repository", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Role. + /// + internal static string role { + get { + return ResourceManager.GetString("role", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Role Code. + /// + internal static string role_code { + get { + return ResourceManager.GetString("role_code", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Role Id. + /// + internal static string role_id { + get { + return ResourceManager.GetString("role_id", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Role Name. + /// + internal static string role_name { + get { + return ResourceManager.GetString("role_name", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Sales Verification Limit. + /// + internal static string sales_verification_limit { + get { + return ResourceManager.GetString("sales_verification_limit", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Selft Verification Limit. + /// + internal static string self_verification_limit { + get { + return ResourceManager.GetString("self_verification_limit", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Selling Price. + /// + internal static string selling_price { + get { + return ResourceManager.GetString("selling_price", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Selling Price Includes Tax. + /// + internal static string selling_price_includes_tax { + get { + return ResourceManager.GetString("selling_price_includes_tax", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Shipper Code. + /// + internal static string shipper_code { + get { + return ResourceManager.GetString("shipper_code", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Shipper Id. + /// + internal static string shipper_id { + get { + return ResourceManager.GetString("shipper_id", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Shipper Name. + /// + internal static string shipper_name { + get { + return ResourceManager.GetString("shipper_name", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Shipping Address. + /// + internal static string shipping_address { + get { + return ResourceManager.GetString("shipping_address", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Shipping Address Code. + /// + internal static string shipping_address_code { + get { + return ResourceManager.GetString("shipping_address_code", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Shipping Address Id. + /// + internal static string shipping_address_id { + get { + return ResourceManager.GetString("shipping_address_id", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Slab Name. + /// + internal static string slab_name { + get { + return ResourceManager.GetString("slab_name", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to SST Number. + /// + internal static string sst_number { + get { + return ResourceManager.GetString("sst_number", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Starts From. + /// + internal static string starts_from { + get { + return ResourceManager.GetString("starts_from", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to State. + /// + internal static string state { + get { + return ResourceManager.GetString("state", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Statement Reference. + /// + internal static string statement_reference { + get { + return ResourceManager.GetString("statement_reference", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Status. + /// + internal static string status { + get { + return ResourceManager.GetString("status", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Stock Master Detail Id. + /// + internal static string stock_master_detail_id { + get { + return ResourceManager.GetString("stock_master_detail_id", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Stock Master Id. + /// + internal static string stock_master_id { + get { + return ResourceManager.GetString("stock_master_id", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Stock Master Rate Id. + /// + internal static string stock_master_rate_id { + get { + return ResourceManager.GetString("stock_master_rate_id", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Store Code. + /// + internal static string store_code { + get { + return ResourceManager.GetString("store_code", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Store Id. + /// + internal static string store_id { + get { + return ResourceManager.GetString("store_id", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Store Name. + /// + internal static string store_name { + get { + return ResourceManager.GetString("store_name", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Store Policy Detail Id. + /// + internal static string store_policy_detail_id { + get { + return ResourceManager.GetString("store_policy_detail_id", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Store Policy Id. + /// + internal static string store_policy_id { + get { + return ResourceManager.GetString("store_policy_id", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Store Type Code. + /// + internal static string store_type_code { + get { + return ResourceManager.GetString("store_type_code", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Store Type Id. + /// + internal static string store_type_id { + get { + return ResourceManager.GetString("store_type_id", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Store Type Name. + /// + internal static string store_type_name { + get { + return ResourceManager.GetString("store_type_name", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Street. + /// + internal static string street { + get { + return ResourceManager.GetString("street", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Sub Total. + /// + internal static string sub_total { + get { + return ResourceManager.GetString("sub_total", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Supplier Code. + /// + internal static string supplier_code { + get { + return ResourceManager.GetString("supplier_code", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Supplier Id. + /// + internal static string supplier_id { + get { + return ResourceManager.GetString("supplier_id", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Supplier Name. + /// + internal static string supplier_name { + get { + return ResourceManager.GetString("supplier_name", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Sys Type. + /// + internal static string sys_type { + get { + return ResourceManager.GetString("sys_type", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Sys User Id. + /// + internal static string sys_user_id { + get { + return ResourceManager.GetString("sys_user_id", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Table Name. + /// + internal static string table_name { + get { + return ResourceManager.GetString("table_name", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Table Schema. + /// + internal static string table_schema { + get { + return ResourceManager.GetString("table_schema", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Tax. + /// + internal static string tax { + get { + return ResourceManager.GetString("tax", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Tax Amount. + /// + internal static string tax_amount { + get { + return ResourceManager.GetString("tax_amount", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Tax Code. + /// + internal static string tax_code { + get { + return ResourceManager.GetString("tax_code", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Tax Id. + /// + internal static string tax_id { + get { + return ResourceManager.GetString("tax_id", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Tax Name. + /// + internal static string tax_name { + get { + return ResourceManager.GetString("tax_name", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Tax Rate. + /// + internal static string tax_rate { + get { + return ResourceManager.GetString("tax_rate", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Tax Type Code. + /// + internal static string tax_type_code { + get { + return ResourceManager.GetString("tax_type_code", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Tax Type Id. + /// + internal static string tax_type_id { + get { + return ResourceManager.GetString("tax_type_id", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Tax Type Name. + /// + internal static string tax_type_name { + get { + return ResourceManager.GetString("tax_type_name", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Total. + /// + internal static string total { + get { + return ResourceManager.GetString("total", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to To Days. + /// + internal static string to_days { + get { + return ResourceManager.GetString("to_days", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Transaction Code. + /// + internal static string transaction_code { + get { + return ResourceManager.GetString("transaction_code", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Transaction Counter. + /// + internal static string transaction_counter { + get { + return ResourceManager.GetString("transaction_counter", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Transaction Date. + /// + internal static string transaction_date { + get { + return ResourceManager.GetString("transaction_date", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Transaction Detail Id. + /// + internal static string transaction_detail_id { + get { + return ResourceManager.GetString("transaction_detail_id", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Transaction Master Id. + /// + internal static string transaction_master_id { + get { + return ResourceManager.GetString("transaction_master_id", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Transaction Ts. + /// + internal static string transaction_ts { + get { + return ResourceManager.GetString("transaction_ts", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Transaction Type. + /// + internal static string transaction_type { + get { + return ResourceManager.GetString("transaction_type", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Type. + /// + internal static string type { + get { + return ResourceManager.GetString("type", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to UDT Name. + /// + internal static string udt_name { + get { + return ResourceManager.GetString("udt_name", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Unit Code. + /// + internal static string unit_code { + get { + return ResourceManager.GetString("unit_code", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Unit Id. + /// + internal static string unit_id { + get { + return ResourceManager.GetString("unit_id", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Unit Name. + /// + internal static string unit_name { + get { + return ResourceManager.GetString("unit_name", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Url. + /// + internal static string url { + get { + return ResourceManager.GetString("url", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to User. + /// + internal static string user { + get { + return ResourceManager.GetString("user", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to User Id. + /// + internal static string user_id { + get { + return ResourceManager.GetString("user_id", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to User Name. + /// + internal static string user_name { + get { + return ResourceManager.GetString("user_name", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Vacuum Count. + /// + internal static string vacuum_count { + get { + return ResourceManager.GetString("vacuum_count", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Value. + /// + internal static string value { + get { + return ResourceManager.GetString("value", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Value Date. + /// + internal static string value_date { + get { + return ResourceManager.GetString("value_date", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Verification. + /// + internal static string verification { + get { + return ResourceManager.GetString("verification", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Verify GL Transactions. + /// + internal static string verify_gl_transactions { + get { + return ResourceManager.GetString("verify_gl_transactions", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Verify Purchase Transactions. + /// + internal static string verify_purchase_transactions { + get { + return ResourceManager.GetString("verify_purchase_transactions", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Verify Sales Transactions. + /// + internal static string verify_sales_transactions { + get { + return ResourceManager.GetString("verify_sales_transactions", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Workcenter Code. + /// + internal static string work_center_code { + get { + return ResourceManager.GetString("work_center_code", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Workcenter Id. + /// + internal static string work_center_id { + get { + return ResourceManager.GetString("work_center_id", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Workcenter Name. + /// + internal static string work_center_name { + get { + return ResourceManager.GetString("work_center_name", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Written By User Id. + /// + internal static string written_by_user_id { + get { + return ResourceManager.GetString("written_by_user_id", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Zip Code. + /// + internal static string zip_code { + get { + return ResourceManager.GetString("zip_code", resourceCulture); + } + } + } +} diff --git a/MixERP.Net.FrontEnd/App_GlobalResources/FormResource.resx b/MixERP.Net.FrontEnd/App_GlobalResources/FormResource.resx new file mode 100644 index 000000000..1803aa2e1 --- /dev/null +++ b/MixERP.Net.FrontEnd/App_GlobalResources/FormResource.resx @@ -0,0 +1,1080 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Account Code + + + Account Id + + + Account Master Code + + + Account Master Id + + + Account Master Name + + + Account Name + + + Activity Id + + + Address + + + Ageing Slab Id + + + Ageing Slab Name + + + Agent Bonus Setup Id + + + Agent Code + + + Agent Id + + + Agent Name + + + Allow Credit + + + Allow Sales + + + Amount + + + Amount From + + + Amount To + + + Assigned By User Id + + + Bank Account Code + + + Bank Account Type + + + Bank Address + + + Bank Branch + + + Bank Contact Number + + + Bank Name + + + Base Quantity + + + Base Unit Id + + + Base Unit Name + + + Bonus Rate + + + Bonus Slab Code + + + Bonus Slab Detail Id + + + Bonus Slab Id + + + Bonus Slab Name + + + Book + + + Brand Code + + + Brand Id + + + Brand Name + + + Browser + + + Cashier Id + + + Cash Repository Code + + + Cash Repository Id + + + Cash Repository Name + + + Cell + + + Charge Interest + + + Checking Frequency Id + + + City + + + Closed + + + Column Default + + + Column Name + + + Commission Rate + + + Company Name + + + Compare Unit Id + + + Compare Unit Name + + + Compound Unit Id + + + Contact Cell + + + Contact City + + + Contact Country + + + Contact Email + + + Contact Number + + + Contact Person + + + Contact Phone + + + Contact State + + + Contact Street + + + Cost Center Code + + + Cost Center Id + + + Cost Center Name + + + Cost Price + + + Cost Price Includes Tax + + + Counter Code + + + Counter Id + + + Counter Name + + + Country + + + CST Number + + + Currency Code + + + Currency Name + + + Currency Symbol + + + Customer Code + + + Customer Id + + + Customer Name + + + Data Type + + + Datetime Precision + + + Date Of Birth + + + Department Code + + + Department Id + + + Department Name + + + Description + + + Details + + + Domain Name + + + Email + + + Ends On + + + Entry Timestamp + + + Event Timestamp + + + Exclude From Purchase + + + Exclude From Sales + + + Factory Address + + + Failed Date Time + + + Failed Login Id + + + Fax + + + First Name + + + Fiscal Year Code + + + Fiscal Year Name + + + Frequency Code + + + Frequency Id + + + Frequency Name + + + Frequency Setup Id + + + From Days + + + Full Name + + + Hot Item + + + Hundredth Name + + + Includes Tax + + + Interest Compounding Frequency Id + + + Interest Rate + + + IP Address + + + Is Cash + + + Is Nullable + + + Item Code + + + Item Cost Price Id + + + Item Group Code + + + Item Group Id + + + Item Group Name + + + Item Id + + + Item Image + + + Item Name + + + Item Opening Inventory Id + + + Item Selling Price Id + + + Last Name + + + Lead Source Code + + + Lead Source Id + + + Lead Source Name + + + Lead Status Code + + + Lead Status Id + + + Lead Status Name + + + Level + + + Lock Out Id + + + Lock Out Till + + + Lock Out Time + + + Logged In Office + + + Logged In Office Id + + + Login Date Time + + + Login Id + + + Maintained By + + + Maintained By User Id + + + Maintain Stock + + + Maximum Credit Amount + + + Maximum Credit Period + + + Menu Code + + + Menu Id + + + Menu Text + + + Middle Name + + + New Val + + + Nick Name + + + Numeric Scale + + + Office + + + Office Code + + + Office Id + + + Office Name + + + Old Val + + + Opportunity Stage Code + + + Opportunity Stage Id + + + Opportunity Stage Name + + + Ordinal Position + + + PAN Number + + + Parent Account Code + + + Parent Account Id + + + Parent Account Name + + + Parent Cash Repository Id + + + Parent Cr Code + + + Parent Cr Name + + + Parent Menu Id + + + Parent Office Id + + + Password + + + Phone + + + Preferred Supplier Id + + + Price + + + Price Type Code + + + Price Type Id + + + Price Type Name + + + Primary Key Id + + + Principal User + + + Quantity + + + Rate + + + Rate Per Base Quantity + + + Rate Per Quantity + + + References Field + + + References Schema + + + References Table + + + Ref No + + + Registration Date + + + Registration Number + + + Relationship Officer Name + + + Relation Officer + + + Remote User + + + Reorder Level + + + Role + + + Role Code + + + Role Id + + + Role Name + + + Selling Price + + + Selling Price Includes Tax + + + Shipper Code + + + Shipper Id + + + Shipper Name + + + Shipping Address + + + Slab Name + + + SST Number + + + Starts From + + + State + + + Status + + + Stock Master Detail Id + + + Stock Master Id + + + Stock Master Rate Id + + + Store Code + + + Store Id + + + Store Name + + + Store Policy Detail Id + + + Store Policy Id + + + Store Type Code + + + Store Type Id + + + Store Type Name + + + Street + + + Supplier Code + + + Supplier Id + + + Supplier Name + + + Sys Type + + + Sys User Id + + + Table Name + + + Table Schema + + + Tax Amount + + + Tax Code + + + Tax Id + + + Tax Name + + + Tax Rate + + + Tax Type Code + + + Tax Type Id + + + Tax Type Name + + + To Days + + + Transaction Code + + + Transaction Counter + + + Transaction Date + + + Transaction Detail Id + + + Transaction Master Id + + + Transaction Ts + + + Transaction Type + + + Type + + + UDT Name + + + Unit Code + + + Unit Id + + + Unit Name + + + Url + + + User Id + + + User Name + + + Value + + + Value Date + + + Verification + + + Written By User Id + + + Zip Code + + + Numeric Precision + + + Numeric Precision Radix + + + Analyze Count + + + Autoanalyze Count + + + Autovacuum Count + + + Last Analaze + + + Last Autoanalyze + + + Last Autovacuum + + + Last Vacuum + + + Relation Name + + + Vacuum Count + + + Discount + + + Sub Total + + + Tax + + + Total + + + Statement Reference + + + Office Address + + + Credit + + + Debit + + + Repository + + + Party Code + + + Party Id + + + Party Name + + + Party Type Id + + + Party Type + + + Minimum Credit + + + Party Type Code + + + Party Type Name + + + Is Supplier + + + Workcenter Code + + + Workcenter Id + + + Workcenter Name + + + Lead Time (In Days) + + + Confidential + + + External Code + + + Can Self Verify + + + Can Verify GL Transactions + + + Can Verify Purchase Transactions + + + Can Verify Sales Transactions + + + Effective From + + + Is Active + + + GL Verification Limit + + + Purchase Verification Limit + + + Sales Verification Limit + + + Selft Verification Limit + + + Verify GL Transactions + + + Verify Purchase Transactions + + + Verify Sales Transactions + + + Is Admin + + + Is System + + + Parent + + + Has Child + + + Address Line 1 + + + Address Line 2 + + + Shipping Address Code + + + Shipping Address Id + + + Party + + + Id + + + Price Type + + + Reference Number + + + User + + + Audit Timestamp + + + Audit User Id + + \ No newline at end of file diff --git a/MixERP.Net.FrontEnd/App_GlobalResources/Labels.Designer.cs b/MixERP.Net.FrontEnd/App_GlobalResources/Labels.Designer.cs new file mode 100644 index 000000000..44b226007 --- /dev/null +++ b/MixERP.Net.FrontEnd/App_GlobalResources/Labels.Designer.cs @@ -0,0 +1,171 @@ +//------------------------------------------------------------------------------ +// +// 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 Resources { + using System; + + + /// + /// A strongly-typed resource class, for looking up localized strings, etc. + /// + // This class was auto-generated by the StronglyTypedResourceBuilder + // class via a tool like ResGen or Visual Studio. + // To add or remove a member, edit your .ResX file then rerun ResGen + // with the /str option or rebuild the Visual Studio project. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Web.Application.StronglyTypedResourceProxyBuilder", "11.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + internal class Labels { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal Labels() { + } + + /// + /// Returns the cached ResourceManager instance used by this class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Resources.ResourceManager ResourceManager { + get { + if (object.ReferenceEquals(resourceMan, null)) { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Resources.Labels", global::System.Reflection.Assembly.Load("App_GlobalResources")); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Overrides the current thread's CurrentUICulture property for all + /// resource lookups using this strongly typed resource class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture { + get { + return resourceCulture; + } + set { + resourceCulture = value; + } + } + + /// + /// Looks up a localized string similar to This field is required.. + /// + internal static string FieldRequired { + get { + return ResourceManager.GetString("FieldRequired", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Loading .... + /// + internal static string Loading { + get { + return ResourceManager.GetString("Loading", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Nothing selected.. + /// + internal static string NothingSelected { + get { + return ResourceManager.GetString("NothingSelected", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Parties collectively refer to suppliers, customers, agents, and dealers.. + /// + internal static string PartyDescription { + get { + return ResourceManager.GetString("PartyDescription", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The fields marked with asterisk (*) are required.. + /// + internal static string RequiredFieldDetails { + get { + return ResourceManager.GetString("RequiredFieldDetails", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The task was completed successfully.. + /// + internal static string TaskCompletedSuccessfully { + get { + return ResourceManager.GetString("TaskCompletedSuccessfully", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The transaction was withdrawn successfully. Moreover, this action will affect the all the reports produced on and after "{0}".. + /// + internal static string TransactionWithdrawnMessage { + get { + return ResourceManager.GetString("TransactionWithdrawnMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to This transaction was approved by {0} on {1}.. + /// + internal static string VerificationApprovedMessage { + get { + return ResourceManager.GetString("VerificationApprovedMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to This transaction is awaiting verification from an administrator.. + /// + internal static string VerificationAwaitingMessage { + get { + return ResourceManager.GetString("VerificationAwaitingMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to This transaction was closed by {0} on {1}. Reason: "{2}".. + /// + internal static string VerificationClosedMessage { + get { + return ResourceManager.GetString("VerificationClosedMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to This transaction was rejected by {0} on {1}. Reason: "{2}".. + /// + internal static string VerificationRejectedMessage { + get { + return ResourceManager.GetString("VerificationRejectedMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to This transaction was withdrawn by {0} on {1}. Reason: "{2}".. + /// + internal static string VerificationWithdrawnMessage { + get { + return ResourceManager.GetString("VerificationWithdrawnMessage", resourceCulture); + } + } + } +} diff --git a/MixERP.Net.FrontEnd/App_GlobalResources/Labels.resx b/MixERP.Net.FrontEnd/App_GlobalResources/Labels.resx new file mode 100644 index 000000000..f795dbfd6 --- /dev/null +++ b/MixERP.Net.FrontEnd/App_GlobalResources/Labels.resx @@ -0,0 +1,161 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + This field is required. + + + Loading ... + + + Nothing selected. + + + Parties collectively refer to suppliers, customers, agents, and dealers. + + + The fields marked with asterisk (*) are required. + + + The task was completed successfully. + + + The transaction was withdrawn successfully. Moreover, this action will affect the all the reports produced on and after "{0}". + The transaction was withdrawn successfully. Moreover, this action will affect the all the reports produced on and after "1/1/2013". + + + This transaction was approved by {0} on {1}. + This transaction was approved by administrator on 1/1/2013. + + + This transaction is awaiting verification from an administrator. + + + This transaction was closed by {0} on {1}. Reason: "{2}". + This transaction was closed by administrator on 1/1/2013. Reason: "Mistake entry.". + + + This transaction was rejected by {0} on {1}. Reason: "{2}". + This transaction was rejected by administrator on 1/1/2013. Reason: "Mistake entry.". + + + This transaction was withdrawn by {0} on {1}. Reason: "{2}". + This transaction was withdrawn by administrator on 1/1/2013. Reason: "Mistake entry.". + + \ No newline at end of file diff --git a/MixERP.Net.FrontEnd/App_GlobalResources/Questions.Designer.cs b/MixERP.Net.FrontEnd/App_GlobalResources/Questions.Designer.cs new file mode 100644 index 000000000..fe56e1dad --- /dev/null +++ b/MixERP.Net.FrontEnd/App_GlobalResources/Questions.Designer.cs @@ -0,0 +1,117 @@ +//------------------------------------------------------------------------------ +// +// 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 Resources { + using System; + + + /// + /// A strongly-typed resource class, for looking up localized strings, etc. + /// + // This class was auto-generated by the StronglyTypedResourceBuilder + // class via a tool like ResGen or Visual Studio. + // To add or remove a member, edit your .ResX file then rerun ResGen + // with the /str option or rebuild the Visual Studio project. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Web.Application.StronglyTypedResourceProxyBuilder", "11.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + internal class Questions { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal Questions() { + } + + /// + /// Returns the cached ResourceManager instance used by this class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Resources.ResourceManager ResourceManager { + get { + if (object.ReferenceEquals(resourceMan, null)) { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Resources.Questions", global::System.Reflection.Assembly.Load("App_GlobalResources")); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Overrides the current thread's CurrentUICulture property for all + /// resource lookups using this strongly typed resource class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture { + get { + return resourceCulture; + } + set { + resourceCulture = value; + } + } + + /// + /// Looks up a localized string similar to Are you sure?. + /// + internal static string AreYouSure { + get { + return ResourceManager.GetString("AreYouSure", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Can't access your account?. + /// + internal static string CantAccessAccount { + get { + return ResourceManager.GetString("CantAccessAccount", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to This will lock client database access during execution. Are you sure you want to execute this action right now?. + /// + internal static string ConfirmAnalyze { + get { + return ResourceManager.GetString("ConfirmAnalyze", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to This will lock client database access during execution. Are you sure you want to execute this action right now?. + /// + internal static string ConfirmVacuum { + get { + return ResourceManager.GetString("ConfirmVacuum", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to This will lock client database access during execution. Are you sure you want to execute this action right now?. + /// + internal static string ConfirmVacuumFull { + get { + return ResourceManager.GetString("ConfirmVacuumFull", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Update tax?. + /// + internal static string UpdateTax { + get { + return ResourceManager.GetString("UpdateTax", resourceCulture); + } + } + } +} diff --git a/MixERP.Net.FrontEnd/App_GlobalResources/Questions.resx b/MixERP.Net.FrontEnd/App_GlobalResources/Questions.resx new file mode 100644 index 000000000..f5fadc4e8 --- /dev/null +++ b/MixERP.Net.FrontEnd/App_GlobalResources/Questions.resx @@ -0,0 +1,138 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Are you sure? + + + Can't access your account? + + + This will lock client database access during execution. Are you sure you want to execute this action right now? + + + This will lock client database access during execution. Are you sure you want to execute this action right now? + + + This will lock client database access during execution. Are you sure you want to execute this action right now? + + + Update tax? + + \ No newline at end of file diff --git a/MixERP.Net.FrontEnd/App_GlobalResources/Setup.Designer.cs b/MixERP.Net.FrontEnd/App_GlobalResources/Setup.Designer.cs new file mode 100644 index 000000000..d5e584e59 --- /dev/null +++ b/MixERP.Net.FrontEnd/App_GlobalResources/Setup.Designer.cs @@ -0,0 +1,72 @@ +//------------------------------------------------------------------------------ +// +// 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 Resources { + using System; + + + /// + /// A strongly-typed resource class, for looking up localized strings, etc. + /// + // This class was auto-generated by the StronglyTypedResourceBuilder + // class via a tool like ResGen or Visual Studio. + // To add or remove a member, edit your .ResX file then rerun ResGen + // with the /str option or rebuild the Visual Studio project. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Web.Application.StronglyTypedResourceProxyBuilder", "11.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + internal class Setup { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal Setup() { + } + + /// + /// Returns the cached ResourceManager instance used by this class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Resources.ResourceManager ResourceManager { + get { + if (object.ReferenceEquals(resourceMan, null)) { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Resources.Setup", global::System.Reflection.Assembly.Load("App_GlobalResources")); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Overrides the current thread's CurrentUICulture property for all + /// resource lookups using this strongly typed resource class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture { + get { + return resourceCulture; + } + set { + resourceCulture = value; + } + } + + /// + /// Looks up a localized string similar to *. + /// + internal static string RequiredFieldIndicator { + get { + return ResourceManager.GetString("RequiredFieldIndicator", resourceCulture); + } + } + } +} diff --git a/MixERP.Net.FrontEnd/App_GlobalResources/Setup.resx b/MixERP.Net.FrontEnd/App_GlobalResources/Setup.resx new file mode 100644 index 000000000..d81000f47 --- /dev/null +++ b/MixERP.Net.FrontEnd/App_GlobalResources/Setup.resx @@ -0,0 +1,123 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + * + + \ No newline at end of file diff --git a/MixERP.Net.FrontEnd/App_GlobalResources/Titles.Designer.cs b/MixERP.Net.FrontEnd/App_GlobalResources/Titles.Designer.cs new file mode 100644 index 000000000..806442bba --- /dev/null +++ b/MixERP.Net.FrontEnd/App_GlobalResources/Titles.Designer.cs @@ -0,0 +1,1602 @@ +//------------------------------------------------------------------------------ +// +// 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 Resources { + using System; + + + /// + /// A strongly-typed resource class, for looking up localized strings, etc. + /// + // This class was auto-generated by the StronglyTypedResourceBuilder + // class via a tool like ResGen or Visual Studio. + // To add or remove a member, edit your .ResX file then rerun ResGen + // with the /str option or rebuild the Visual Studio project. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Web.Application.StronglyTypedResourceProxyBuilder", "11.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + internal class Titles { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal Titles() { + } + + /// + /// Returns the cached ResourceManager instance used by this class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Resources.ResourceManager ResourceManager { + get { + if (object.ReferenceEquals(resourceMan, null)) { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Resources.Titles", global::System.Reflection.Assembly.Load("App_GlobalResources")); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Overrides the current thread's CurrentUICulture property for all + /// resource lookups using this strongly typed resource class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture { + get { + return resourceCulture; + } + set { + resourceCulture = value; + } + } + + /// + /// Looks up a localized string similar to Account. + /// + internal static string Account { + get { + return ResourceManager.GetString("Account", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Account Code. + /// + internal static string AccountCode { + get { + return ResourceManager.GetString("AccountCode", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Action. + /// + internal static string Action { + get { + return ResourceManager.GetString("Action", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Add. + /// + internal static string Add { + get { + return ResourceManager.GetString("Add", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Add New. + /// + internal static string AddNew { + get { + return ResourceManager.GetString("AddNew", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Add a New Entry. + /// + internal static string AddNewEntry { + get { + return ResourceManager.GetString("AddNewEntry", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Ageing Slab Setup. + /// + internal static string AgeingSlabSetup { + get { + return ResourceManager.GetString("AgeingSlabSetup", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Agent Bonus Slab Assignment. + /// + internal static string AgentBonusSlabAssignment { + get { + return ResourceManager.GetString("AgentBonusSlabAssignment", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Agent Bonus Slabs. + /// + internal static string AgentBonusSlabs { + get { + return ResourceManager.GetString("AgentBonusSlabs", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Agent Setup. + /// + internal static string AgentSetup { + get { + return ResourceManager.GetString("AgentSetup", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Amount. + /// + internal static string Amount { + get { + return ResourceManager.GetString("Amount", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Analyze Databse. + /// + internal static string AnalyzeDatabse { + get { + return ResourceManager.GetString("AnalyzeDatabse", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Auto Verification Policy. + /// + internal static string AutoVerificationPolicy { + get { + return ResourceManager.GetString("AutoVerificationPolicy", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Back. + /// + internal static string Back { + get { + return ResourceManager.GetString("Back", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Bank Accounts. + /// + internal static string BankAccounts { + get { + return ResourceManager.GetString("BankAccounts", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Bonus Slab Details. + /// + internal static string BonusSlabDetails { + get { + return ResourceManager.GetString("BonusSlabDetails", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Book. + /// + internal static string Book { + get { + return ResourceManager.GetString("Book", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Brands. + /// + internal static string Brands { + get { + return ResourceManager.GetString("Brands", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Cancel. + /// + internal static string Cancel { + get { + return ResourceManager.GetString("Cancel", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Cash. + /// + internal static string Cash { + get { + return ResourceManager.GetString("Cash", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Cash Repositories. + /// + internal static string CashRepositories { + get { + return ResourceManager.GetString("CashRepositories", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Cash Repository. + /// + internal static string CashRepository { + get { + return ResourceManager.GetString("CashRepository", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Cash Repository Balance. + /// + internal static string CashRepositoryBalance { + get { + return ResourceManager.GetString("CashRepositoryBalance", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Chart of Accounts. + /// + internal static string ChartOfAccounts { + get { + return ResourceManager.GetString("ChartOfAccounts", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Checklists. + /// + internal static string Checklists { + get { + return ResourceManager.GetString("Checklists", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Clear. + /// + internal static string Clear { + get { + return ResourceManager.GetString("Clear", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Code. + /// + internal static string Code { + get { + return ResourceManager.GetString("Code", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Compound Units of Measure. + /// + internal static string CompoundUnitsOfMeasure { + get { + return ResourceManager.GetString("CompoundUnitsOfMeasure", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Cost Center. + /// + internal static string CostCenter { + get { + return ResourceManager.GetString("CostCenter", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Cost Centers. + /// + internal static string CostCenters { + get { + return ResourceManager.GetString("CostCenters", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Counters. + /// + internal static string Counters { + get { + return ResourceManager.GetString("Counters", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Credit. + /// + internal static string Credit { + get { + return ResourceManager.GetString("Credit", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Credit Total. + /// + internal static string CreditTotal { + get { + return ResourceManager.GetString("CreditTotal", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Currencies. + /// + internal static string Currencies { + get { + return ResourceManager.GetString("Currencies", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Customer Code. + /// + internal static string CustomerCode { + get { + return ResourceManager.GetString("CustomerCode", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Customer Name. + /// + internal static string CustomerName { + get { + return ResourceManager.GetString("CustomerName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Customer PAN Number. + /// + internal static string CustomerPanNumber { + get { + return ResourceManager.GetString("CustomerPanNumber", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Database Statistics. + /// + internal static string DatabaseStatistics { + get { + return ResourceManager.GetString("DatabaseStatistics", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Date. + /// + internal static string Date { + get { + return ResourceManager.GetString("Date", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Debit. + /// + internal static string Debit { + get { + return ResourceManager.GetString("Debit", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Debit Total. + /// + internal static string DebitTotal { + get { + return ResourceManager.GetString("DebitTotal", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Delete Selected. + /// + internal static string DeleteSelected { + get { + return ResourceManager.GetString("DeleteSelected", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Deliver To. + /// + internal static string DeliverTo { + get { + return ResourceManager.GetString("DeliverTo", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Delivery Without Sales Order. + /// + internal static string DeliveryWithoutSalesOrder { + get { + return ResourceManager.GetString("DeliveryWithoutSalesOrder", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Departments. + /// + internal static string Departments { + get { + return ResourceManager.GetString("Departments", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Direct Purchase. + /// + internal static string DirectPurchase { + get { + return ResourceManager.GetString("DirectPurchase", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Direct Sales. + /// + internal static string DirectSales { + get { + return ResourceManager.GetString("DirectSales", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Discount. + /// + internal static string Discount { + get { + return ResourceManager.GetString("Discount", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Dr. + /// + internal static string Dr { + get { + return ResourceManager.GetString("Dr", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Due Date. + /// + internal static string DueDate { + get { + return ResourceManager.GetString("DueDate", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Edit Selected. + /// + internal static string EditSelected { + get { + return ResourceManager.GetString("EditSelected", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Email. + /// + internal static string Email { + get { + return ResourceManager.GetString("Email", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Email This Invoice. + /// + internal static string EmailThisInvoice { + get { + return ResourceManager.GetString("EmailThisInvoice", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Entered By. + /// + internal static string EnteredBy { + get { + return ResourceManager.GetString("EnteredBy", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Execute. + /// + internal static string Execute { + get { + return ResourceManager.GetString("Execute", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Fax. + /// + internal static string Fax { + get { + return ResourceManager.GetString("Fax", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Flag Selection. + /// + internal static string FlagSelection { + get { + return ResourceManager.GetString("FlagSelection", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Frequencies. + /// + internal static string Frequencies { + get { + return ResourceManager.GetString("Frequencies", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to GL Advice. + /// + internal static string GLAdvice { + get { + return ResourceManager.GetString("GLAdvice", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to GL Details. + /// + internal static string GLDetails { + get { + return ResourceManager.GetString("GLDetails", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Go. + /// + internal static string Go { + get { + return ResourceManager.GetString("Go", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Goods Receipt Note. + /// + internal static string GoodsReceiptNote { + get { + return ResourceManager.GetString("GoodsReceiptNote", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Go To Top. + /// + internal static string GoToTop { + get { + return ResourceManager.GetString("GoToTop", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Grand Total. + /// + internal static string GrandTotal { + get { + return ResourceManager.GetString("GrandTotal", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Invoice Amount. + /// + internal static string InvoiceAmount { + get { + return ResourceManager.GetString("InvoiceAmount", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Invoice Details. + /// + internal static string InvoiceDetails { + get { + return ResourceManager.GetString("InvoiceDetails", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Item Cost Prices. + /// + internal static string ItemCostPrices { + get { + return ResourceManager.GetString("ItemCostPrices", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Item Groups. + /// + internal static string ItemGroups { + get { + return ResourceManager.GetString("ItemGroups", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Item Name. + /// + internal static string ItemName { + get { + return ResourceManager.GetString("ItemName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Items. + /// + internal static string Items { + get { + return ResourceManager.GetString("Items", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Item Selling Prices. + /// + internal static string ItemSellingPrices { + get { + return ResourceManager.GetString("ItemSellingPrices", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Journal Voucher Entry. + /// + internal static string JournalVoucherEntry { + get { + return ResourceManager.GetString("JournalVoucherEntry", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Lead Sources. + /// + internal static string LeadSources { + get { + return ResourceManager.GetString("LeadSources", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Lead Statuses. + /// + internal static string LeadStatuses { + get { + return ResourceManager.GetString("LeadStatuses", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Load. + /// + internal static string Load { + get { + return ResourceManager.GetString("Load", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Login View. + /// + internal static string LoginView { + get { + return ResourceManager.GetString("LoginView", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Merge and Convert Batch to Sales Delivery. + /// + internal static string MergeBatchConvertToSalesDelivery { + get { + return ResourceManager.GetString("MergeBatchConvertToSalesDelivery", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Merge Batch to Sales Delivery. + /// + internal static string MergeBatchToSalesDelivery { + get { + return ResourceManager.GetString("MergeBatchToSalesDelivery", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Merge Batch to Sales Order. + /// + internal static string MergeBatchToSalesOrder { + get { + return ResourceManager.GetString("MergeBatchToSalesOrder", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Office. + /// + internal static string Office { + get { + return ResourceManager.GetString("Office", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Office Code. + /// + internal static string OfficeCode { + get { + return ResourceManager.GetString("OfficeCode", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Office Setup. + /// + internal static string OfficeSetup { + get { + return ResourceManager.GetString("OfficeSetup", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to OK. + /// + internal static string OK { + get { + return ResourceManager.GetString("OK", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Opportunity Stages. + /// + internal static string OpportunityStages { + get { + return ResourceManager.GetString("OpportunityStages", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Other Details. + /// + internal static string OtherDetails { + get { + return ResourceManager.GetString("OtherDetails", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Pan Number. + /// + internal static string PanNumber { + get { + return ResourceManager.GetString("PanNumber", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Party Maintenance. + /// + internal static string PartyMaintenance { + get { + return ResourceManager.GetString("PartyMaintenance", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Party Types. + /// + internal static string PartyTypes { + get { + return ResourceManager.GetString("PartyTypes", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Password. + /// + internal static string Password { + get { + return ResourceManager.GetString("Password", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Post Transaction. + /// + internal static string PostTransaction { + get { + return ResourceManager.GetString("PostTransaction", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Prepared On. + /// + internal static string PreparedOn { + get { + return ResourceManager.GetString("PreparedOn", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Price. + /// + internal static string Price { + get { + return ResourceManager.GetString("Price", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Price Type. + /// + internal static string PriceType { + get { + return ResourceManager.GetString("PriceType", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Print. + /// + internal static string Print { + get { + return ResourceManager.GetString("Print", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Printed On. + /// + internal static string PrintedOn { + get { + return ResourceManager.GetString("PrintedOn", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Print GL Entry. + /// + internal static string PrintGLEntry { + get { + return ResourceManager.GetString("PrintGLEntry", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Print Receipt. + /// + internal static string PrintReceipt { + get { + return ResourceManager.GetString("PrintReceipt", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Print This Invoice. + /// + internal static string PrintThisInvoice { + get { + return ResourceManager.GetString("PrintThisInvoice", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Purchase Invoice. + /// + internal static string PurchaseInvoice { + get { + return ResourceManager.GetString("PurchaseInvoice", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Purchase Order. + /// + internal static string PurchaseOrder { + get { + return ResourceManager.GetString("PurchaseOrder", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Purchase Type. + /// + internal static string PurchaseType { + get { + return ResourceManager.GetString("PurchaseType", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Qty. + /// + internal static string QuantityAbbreviated { + get { + return ResourceManager.GetString("QuantityAbbreviated", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Rate. + /// + internal static string Rate { + get { + return ResourceManager.GetString("Rate", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Reference Number. + /// + internal static string ReferenceNumber { + get { + return ResourceManager.GetString("ReferenceNumber", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Ref#. + /// + internal static string ReferenceNumberAbbreviated { + get { + return ResourceManager.GetString("ReferenceNumberAbbreviated", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Remember Me. + /// + internal static string RememberMe { + get { + return ResourceManager.GetString("RememberMe", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Report Not Found. + /// + internal static string ReportNotFound { + get { + return ResourceManager.GetString("ReportNotFound", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Reset. + /// + internal static string Reset { + get { + return ResourceManager.GetString("Reset", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Role Maintenance. + /// + internal static string RoleMaintenance { + get { + return ResourceManager.GetString("RoleMaintenance", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Run. + /// + internal static string Run { + get { + return ResourceManager.GetString("Run", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Running Total. + /// + internal static string RunningTotal { + get { + return ResourceManager.GetString("RunningTotal", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Sales Delivery. + /// + internal static string SalesDelivery { + get { + return ResourceManager.GetString("SalesDelivery", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Sales Delivery Note. + /// + internal static string SalesDeliveryNote { + get { + return ResourceManager.GetString("SalesDeliveryNote", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Sales Invoice. + /// + internal static string SalesInvoice { + get { + return ResourceManager.GetString("SalesInvoice", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Sales Order. + /// + internal static string SalesOrder { + get { + return ResourceManager.GetString("SalesOrder", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Sales Person. + /// + internal static string SalesPerson { + get { + return ResourceManager.GetString("SalesPerson", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Sales Quotation. + /// + internal static string SalesQuotation { + get { + return ResourceManager.GetString("SalesQuotation", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Sales Type. + /// + internal static string SalesType { + get { + return ResourceManager.GetString("SalesType", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Save. + /// + internal static string Save { + get { + return ResourceManager.GetString("Save", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Save. + /// + internal static string Save1 { + get { + return ResourceManager.GetString("Save1", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Select. + /// + internal static string Select { + get { + return ResourceManager.GetString("Select", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Select Party. + /// + internal static string SelectParty { + get { + return ResourceManager.GetString("SelectParty", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Select Store. + /// + internal static string SelectStore { + get { + return ResourceManager.GetString("SelectStore", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Select Supplier. + /// + internal static string SelectSupplier { + get { + return ResourceManager.GetString("SelectSupplier", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Select Your Branch. + /// + internal static string SelectYourBranch { + get { + return ResourceManager.GetString("SelectYourBranch", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Shipper. + /// + internal static string Shipper { + get { + return ResourceManager.GetString("Shipper", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Shippers. + /// + internal static string Shippers { + get { + return ResourceManager.GetString("Shippers", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Shipping Address. + /// + internal static string ShippingAddress { + get { + return ResourceManager.GetString("ShippingAddress", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Shipping Address Maintenance. + /// + internal static string ShippingAddressMaintenance { + get { + return ResourceManager.GetString("ShippingAddressMaintenance", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Shipping Charge. + /// + internal static string ShippingCharge { + get { + return ResourceManager.GetString("ShippingCharge", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Shipping Company. + /// + internal static string ShippingCompany { + get { + return ResourceManager.GetString("ShippingCompany", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Show All. + /// + internal static string ShowAll { + get { + return ResourceManager.GetString("ShowAll", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Show Compact. + /// + internal static string ShowCompact { + get { + return ResourceManager.GetString("ShowCompact", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Sign In. + /// + internal static string SignIn { + get { + return ResourceManager.GetString("SignIn", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Statement Reference. + /// + internal static string StatementReference { + get { + return ResourceManager.GetString("StatementReference", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Stores. + /// + internal static string Stores { + get { + return ResourceManager.GetString("Stores", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Store Types. + /// + internal static string StoreTypes { + get { + return ResourceManager.GetString("StoreTypes", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Sign In. + /// + internal static string String1 { + get { + return ResourceManager.GetString("String1", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Remember Me. + /// + internal static string String2 { + get { + return ResourceManager.GetString("String2", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Sub Total. + /// + internal static string SubTotal { + get { + return ResourceManager.GetString("SubTotal", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Supplier Name. + /// + internal static string SupplierName { + get { + return ResourceManager.GetString("SupplierName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Tax. + /// + internal static string Tax { + get { + return ResourceManager.GetString("Tax", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Tax Setup. + /// + internal static string TaxSetup { + get { + return ResourceManager.GetString("TaxSetup", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Tax Total. + /// + internal static string TaxTotal { + get { + return ResourceManager.GetString("TaxTotal", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Tax Types. + /// + internal static string TaxTypes { + get { + return ResourceManager.GetString("TaxTypes", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Tel. + /// + internal static string Tel { + get { + return ResourceManager.GetString("Tel", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Total. + /// + internal static string Total { + get { + return ResourceManager.GetString("Total", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Totals. + /// + internal static string Totals { + get { + return ResourceManager.GetString("Totals", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Tran Code. + /// + internal static string TranCode { + get { + return ResourceManager.GetString("TranCode", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Transaction Date. + /// + internal static string TransactionDate { + get { + return ResourceManager.GetString("TransactionDate", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Transaction Details. + /// + internal static string TransactionDetails { + get { + return ResourceManager.GetString("TransactionDetails", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Transaction Posted Successfully. + /// + internal static string TransactionPostedSuccessfully { + get { + return ResourceManager.GetString("TransactionPostedSuccessfully", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Transaction Status. + /// + internal static string TransactionStatus { + get { + return ResourceManager.GetString("TransactionStatus", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Unit. + /// + internal static string Unit { + get { + return ResourceManager.GetString("Unit", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Units of Measure. + /// + internal static string UnitsOfMeasure { + get { + return ResourceManager.GetString("UnitsOfMeasure", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Update. + /// + internal static string Update { + get { + return ResourceManager.GetString("Update", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Upload Attachment for This Transaction. + /// + internal static string UploadAttachmentForThisTransaction { + get { + return ResourceManager.GetString("UploadAttachmentForThisTransaction", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Url. + /// + internal static string Url { + get { + return ResourceManager.GetString("Url", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to User. + /// + internal static string User { + get { + return ResourceManager.GetString("User", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to User Id. + /// + internal static string UserId { + get { + return ResourceManager.GetString("UserId", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Vacuum Database. + /// + internal static string VacuumDatabase { + get { + return ResourceManager.GetString("VacuumDatabase", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Vacuum Database (Full). + /// + internal static string VacuumFullDatabase { + get { + return ResourceManager.GetString("VacuumFullDatabase", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Value Date. + /// + internal static string ValueDate { + get { + return ResourceManager.GetString("ValueDate", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Verification Reason. + /// + internal static string VerificationReason { + get { + return ResourceManager.GetString("VerificationReason", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Verified By. + /// + internal static string VerifiedBy { + get { + return ResourceManager.GetString("VerifiedBy", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to View This Invoice. + /// + internal static string ViewThisInvoice { + get { + return ResourceManager.GetString("ViewThisInvoice", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Voucher Verification Policy. + /// + internal static string VoucherVerificationPolicy { + get { + return ResourceManager.GetString("VoucherVerificationPolicy", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Withdrawal Reason. + /// + internal static string WithdrawalReason { + get { + return ResourceManager.GetString("WithdrawalReason", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Withdraw This Transaction. + /// + internal static string WithdrawThisTransaction { + get { + return ResourceManager.GetString("WithdrawThisTransaction", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Withdraw Transaction. + /// + internal static string WithdrawTransaction { + get { + return ResourceManager.GetString("WithdrawTransaction", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Yes, No. + /// + internal static string YesNo { + get { + return ResourceManager.GetString("YesNo", resourceCulture); + } + } + } +} diff --git a/MixERP.Net.FrontEnd/App_GlobalResources/Titles.resx b/MixERP.Net.FrontEnd/App_GlobalResources/Titles.resx new file mode 100644 index 000000000..d18fda1f2 --- /dev/null +++ b/MixERP.Net.FrontEnd/App_GlobalResources/Titles.resx @@ -0,0 +1,633 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Action + + + Add + + + Add New + + + Add a New Entry + + + Ageing Slab Setup + + + Amount + + + Cancel + + + Cash + + + Cash Repository + + + Cash Repository Balance + + + Code + + + Cost Center + + + Credit + + + Delete Selected + + + Discount + + + Dr + + + Edit Selected + + + Email + + + Fax + + + Grand Total + + + Item Name + + + Office Code + + + OK + + + Price + + + Price Type + + + Print + + + Printed On + + + Qty + + + Rate + + + Reset + + + Running Total + + + Save + + + Select + + + Select Party + + + Select Store + + + Select Supplier + + + Show All + + + Show Compact + + + Statement Reference + + + Sub Total + + + Tax + + + Tax Total + + + Tel + + + Total + + + Totals + + + Unit + + + Url + + + User + + + Value Date + + + Yes, No + + + Shipping Charge + + + Shipping Company + + + Sales Invoice + + + Customer Name + + + Date + + + Office + + + Sales Type + + + Tran Code + + + Invoice Details + + + Other Details + + + Shipper + + + Pan Number + + + Report Not Found + + + Prepared On + + + Login View + + + Customer Code + + + Customer PAN Number + + + Deliver To + + + Due Date + + + Transaction Date + + + Invoice Amount + + + Entered By + + + Transaction Status + + + Verified By + + + Verification Reason + + + Book + + + GL Advice + + + Reference Number + + + Transaction Details + + + GL Details + + + Party Maintenance + + + Party Types + + + Account + + + Account Code + + + Debit + + + Credit Total + + + Debit Total + + + Transaction Posted Successfully + + + Auto Verification Policy + + + Voucher Verification Policy + + + Direct Sales + + + Agent Bonus Slab Assignment + + + Agent Bonus Slabs + + + Agent Setup + + + Analyze Databse + + + Back + + + Bank Accounts + + + Bonus Slab Details + + + Brands + + + Cash Repositories + + + Chart of Accounts + + + Clear + + + Compound Units of Measure + + + Cost Centers + + + Counters + + + Currencies + + + Database Statistics + + + Departments + + + Direct Purchase + + + Email This Invoice + + + Execute + + + Frequencies + + + Goods Receipt Note + + + Go To Top + + + Item Cost Prices + + + Item Groups + + + Items + + + Item Selling Prices + + + Journal Voucher Entry + + + Lead Sources + + + Lead Statuses + + + Load + + + Office Setup + + + Opportunity Stages + + + Post Transaction + + + Print GL Entry + + + Print Receipt + + + Print This Invoice + + + Purchase Order + + + Remember Me + + + Role Maintenance + + + Run + + + Sales Order + + + Sales Quotation + + + Save + + + Shippers + + + Sign In + + + Stores + + + Store Types + + + Tax Setup + + + Tax Types + + + Units of Measure + + + Upload Attachment for This Transaction + + + Vacuum Database + + + Vacuum Database (Full) + + + View This Invoice + + + Withdraw This Transaction + + + Password + + + Sign In + + + Remember Me + + + User Id + + + Select Your Branch + + + Checklists + + + Withdraw Transaction + + + Withdrawal Reason + + + Go + + + Purchase Invoice + + + Purchase Type + + + Supplier Name + + + Update + + + Delivery Without Sales Order + + + Sales Delivery Note + + + Sales Delivery + + + Ref# + + + Sales Person + + + Shipping Address Maintenance + + + Flag Selection + + + Merge and Convert Batch to Sales Delivery + + + Merge Batch to Sales Order + + + Shipping Address + + + Merge Batch to Sales Delivery + + \ No newline at end of file diff --git a/MixERP.Net.FrontEnd/App_GlobalResources/Warnings.Designer.cs b/MixERP.Net.FrontEnd/App_GlobalResources/Warnings.Designer.cs new file mode 100644 index 000000000..e66258c49 --- /dev/null +++ b/MixERP.Net.FrontEnd/App_GlobalResources/Warnings.Designer.cs @@ -0,0 +1,216 @@ +//------------------------------------------------------------------------------ +// +// 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 Resources { + using System; + + + /// + /// A strongly-typed resource class, for looking up localized strings, etc. + /// + // This class was auto-generated by the StronglyTypedResourceBuilder + // class via a tool like ResGen or Visual Studio. + // To add or remove a member, edit your .ResX file then rerun ResGen + // with the /str option or rebuild the Visual Studio project. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Web.Application.StronglyTypedResourceProxyBuilder", "11.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + internal class Warnings { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal Warnings() { + } + + /// + /// Returns the cached ResourceManager instance used by this class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Resources.ResourceManager ResourceManager { + get { + if (object.ReferenceEquals(resourceMan, null)) { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Resources.Warnings", global::System.Reflection.Assembly.Load("App_GlobalResources")); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Overrides the current thread's CurrentUICulture property for all + /// resource lookups using this strongly typed resource class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture { + get { + return resourceCulture; + } + set { + resourceCulture = value; + } + } + + /// + /// Looks up a localized string similar to Access is denied.. + /// + internal static string AccessDenied { + get { + return ResourceManager.GetString("AccessDenied", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Both debit and credit side have values.. + /// + internal static string BothSidesHaveValue { + get { + return ResourceManager.GetString("BothSidesHaveValue", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to You may not withdraw else's transaction.. + /// + internal static string CannotWithdrawElsesTransaction { + get { + return ResourceManager.GetString("CannotWithdrawElsesTransaction", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to You cannot withdraw this transaction at this stage. Consult an administrator if this transaction could be rejected.. + /// + internal static string CannotWithdrawTransaction { + get { + return ResourceManager.GetString("CannotWithdrawTransaction", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Credit is not allowed to this customer.. + /// + internal static string CreditNotAllowed { + get { + return ResourceManager.GetString("CreditNotAllowed", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Only {0} {1} of {2} left in stock.. + /// + internal static string InsufficientStockWarning { + get { + return ResourceManager.GetString("InsufficientStockWarning", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to This is not a valid date.. + /// + internal static string InvalidDate { + get { + return ResourceManager.GetString("InvalidDate", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to This is not a valid image.. + /// + internal static string InvalidImage { + get { + return ResourceManager.GetString("InvalidImage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to "{0}" is not a valid path or location.. + /// + internal static string InvalidLocation { + get { + return ResourceManager.GetString("InvalidLocation", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to No item found.. + /// + internal static string NoItemFound { + get { + return ResourceManager.GetString("NoItemFound", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Not enough cash in the repository.. + /// + internal static string NotEnoughCash { + get { + return ResourceManager.GetString("NotEnoughCash", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Only numbers are allowed.. + /// + internal static string OnlyNumbersAllowed { + get { + return ResourceManager.GetString("OnlyNumbersAllowed", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to This is a required field.. + /// + internal static string RequiredField { + get { + return ResourceManager.GetString("RequiredField", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Sales is not allowed here.. + /// + internal static string SalesNotAllowedHere { + get { + return ResourceManager.GetString("SalesNotAllowedHere", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Operation failed due to an unknown error.. + /// + internal static string UnknownError { + get { + return ResourceManager.GetString("UnknownError", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Unknown transaction type.. + /// + internal static string UnknownTransactionType { + get { + return ResourceManager.GetString("UnknownTransactionType", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to User id or password incorrect.. + /// + internal static string UserIdOrPasswordIncorrect { + get { + return ResourceManager.GetString("UserIdOrPasswordIncorrect", resourceCulture); + } + } + } +} diff --git a/MixERP.Net.FrontEnd/App_GlobalResources/Warnings.resx b/MixERP.Net.FrontEnd/App_GlobalResources/Warnings.resx new file mode 100644 index 000000000..4a0f1cc62 --- /dev/null +++ b/MixERP.Net.FrontEnd/App_GlobalResources/Warnings.resx @@ -0,0 +1,172 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Access is denied. + + + Both debit and credit side have values. + + + You may not withdraw else's transaction. + + + You cannot withdraw this transaction at this stage. Consult an administrator if this transaction could be rejected. + + + Credit is not allowed to this customer. + + + Only {0} {1} of {2} left in stock. + Only {Qty} {Unit} of {ItemName} left in stock. + + + This is not a valid date. + + + This is not a valid image. + + + "{0}" is not a valid path or location. + + + No item found. + + + Not enough cash in the repository. + + + Only numbers are allowed. + + + This is a required field. + + + Sales is not allowed here. + + + Operation failed due to an unknown error. + + + Unknown transaction type. + + + User id or password incorrect. + + \ No newline at end of file diff --git a/MixERP.Net.FrontEnd/App_Themes/MixERP/Default.css b/MixERP.Net.FrontEnd/App_Themes/MixERP/Default.css new file mode 100644 index 000000000..1dfe40863 --- /dev/null +++ b/MixERP.Net.FrontEnd/App_Themes/MixERP/Default.css @@ -0,0 +1,175 @@ +html, body, table, tr, td, h1, h2, h3, h4, h5, input, select, p, textarea +{ + font-family: 'Segoe UI', 'Tahoma', 'Arial'; +} + + +.sign-in-logo +{ + width: 300px; + margin: auto; + margin-top: 160px; +} + +.sign-in +{ + width: 300px; + margin: auto; + height: 240px; + background-color: #F0F0F0; + padding: 12px; +} + + .sign-in:hover + { + background-color: #F0F0E0; + } + +a img +{ + border: none; +} + +a +{ + text-decoration: none; +} + + h1:hover, h2:hover, h3:hover, h4:hover, h5:hover, h6:hover, a:hover, span:hover, table:hover, tr:hover, td:hover, div:hover + { + -webkit-transition: all 500ms ease; + -moz-transition: all 500ms ease; + -o-transition: all 500ms ease; + -ms-transition: all 500ms ease; + transition: all 500ms ease; + } + +.ajax-container +{ + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; + z-index: 1000; + background-color: #A7D0D9; + opacity: .5; +} + +.ajax-loader +{ + position: absolute; + left: 50%; + top: 50%; + margin-left: -32px; /* -1 * image width / 2 */ + margin-top: -32px; /* -1 * image height / 2 */ + display: block; + opacity: 0.9; +} + + +.report-parameter +{ + border: 1px solid #EDCAF7; + background-color: #F8EBFC; + position: absolute; + right: 20px; + top: 50px; + padding: 12px; +} + + .report-parameter table + { + border-collapse: collapse; + color: #8F16B8; + } + + .report-parameter table tr td, .report-parameter table tr td input + { + outline: none; + font-size: 11px; + color: #8F16B8; + } + + .report-parameter table tr td input + { + border: 1px solid #F3DFFF; + } + + .report-parameter table tr td:first-child + { + padding: 4px; + width: 132px; + } + + + + + + + + + + + + + + body + { + font-size: 11px!important; + } + + hr + { + border: 1px solid gray; + border-top: 0px; + } + + table.report tr th, table.report tr td + { + padding: 4px; + } + + + .table + { + border-collapse: collapse; + border: 1px solid gray; + min-width: 400px; + } + + .table td + { + border: 1px solid gray; + padding: 4px!important; + } + + table.horizontal > tbody > tr > td:first-child + { + width: 180px; + font-weight: bold; + } + + + .report-command + { + border: 1px solid #EDCAF7; + position: absolute; + padding: 4px 12px 4px 12px; + top: 20px; + right: 20px; + background-color: #F8EBFC; + } + + .report-command:hover + { + background-color: #F2DAFA; + } + + @media print + { + .hide + { + display: none; + } + } diff --git a/MixERP.Net.FrontEnd/App_Themes/MixERP/Skin1.skin b/MixERP.Net.FrontEnd/App_Themes/MixERP/Skin1.skin new file mode 100644 index 000000000..1866e6323 --- /dev/null +++ b/MixERP.Net.FrontEnd/App_Themes/MixERP/Skin1.skin @@ -0,0 +1,9 @@ +<%-- + + +--%> \ No newline at end of file diff --git a/MixERP.Net.FrontEnd/CRM/ConvertLeadToOpportunity.aspx b/MixERP.Net.FrontEnd/CRM/ConvertLeadToOpportunity.aspx new file mode 100644 index 000000000..0682736bd --- /dev/null +++ b/MixERP.Net.FrontEnd/CRM/ConvertLeadToOpportunity.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="ConvertLeadToOpportunity.aspx.cs" Inherits="MixERP.Net.FrontEnd.CRM.ConvertLeadToOpportunity" %> + + + + + + + + diff --git a/MixERP.Net.FrontEnd/CRM/ConvertLeadToOpportunity.aspx.cs b/MixERP.Net.FrontEnd/CRM/ConvertLeadToOpportunity.aspx.cs new file mode 100644 index 000000000..7423a3862 --- /dev/null +++ b/MixERP.Net.FrontEnd/CRM/ConvertLeadToOpportunity.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 ConvertLeadToOpportunity : 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/ConvertLeadToOpportunity.aspx.designer.cs b/MixERP.Net.FrontEnd/CRM/ConvertLeadToOpportunity.aspx.designer.cs new file mode 100644 index 000000000..3eee72547 --- /dev/null +++ b/MixERP.Net.FrontEnd/CRM/ConvertLeadToOpportunity.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 ConvertLeadToOpportunity { + + protected System.Web.UI.WebControls.Content Content1; + } +} diff --git a/MixERP.Net.FrontEnd/CRM/Index.aspx b/MixERP.Net.FrontEnd/CRM/Index.aspx new file mode 100644 index 000000000..2d0bcb617 --- /dev/null +++ b/MixERP.Net.FrontEnd/CRM/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.CRM.Index" %> + + + + + +

+ Customer Relationship Management +

+
+ +
+ + 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" %> + + + + + + + + + + + + + +
+ progress +
+
+
+ + + + + + + +
+
+ + + + + + + + + +
+ + + +
+ + + +
+
+
+ + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+
+ +
+
+ + + + + + + + + + + + + + + + + +
+ + + +
+ + + +
+ + + +
+ + +
+
+
+
+
+
+ + + 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/MenuMaster.Master.cs b/MixERP.Net.FrontEnd/MenuMaster.Master.cs new file mode 100644 index 000000000..81cad8e24 --- /dev/null +++ b/MixERP.Net.FrontEnd/MenuMaster.Master.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 +{ + public partial class MenuMaster : System.Web.UI.MasterPage + { + protected void Page_Load(object sender, EventArgs e) + { + + } + } +} \ No newline at end of file diff --git a/MixERP.Net.FrontEnd/MenuMaster.Master.designer.cs b/MixERP.Net.FrontEnd/MenuMaster.Master.designer.cs new file mode 100644 index 000000000..de2ef4b71 --- /dev/null +++ b/MixERP.Net.FrontEnd/MenuMaster.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 MenuMaster { + + protected System.Web.UI.WebControls.Content Content1; + + protected System.Web.UI.WebControls.ContentPlaceHolder ScriptContentPlaceHolder; + } +} diff --git a/MixERP.Net.FrontEnd/Mix Open Foundation.snk b/MixERP.Net.FrontEnd/Mix Open Foundation.snk new file mode 100644 index 000000000..11572dc3d Binary files /dev/null and b/MixERP.Net.FrontEnd/Mix Open Foundation.snk differ diff --git a/MixERP.Net.FrontEnd/MixERP.Net.FrontEnd.csproj b/MixERP.Net.FrontEnd/MixERP.Net.FrontEnd.csproj new file mode 100644 index 000000000..d1b8d4040 --- /dev/null +++ b/MixERP.Net.FrontEnd/MixERP.Net.FrontEnd.csproj @@ -0,0 +1,1654 @@ + + + + + Debug + AnyCPU + + + 2.0 + {ACE1017D-71BC-4417-A906-72C4B9C55823} + {349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc} + Library + Properties + MixERP.Net.FrontEnd + MixERP.Net.FrontEnd + v4.0 + true + + + + + + + + true + full + false + bin\ + DEBUG;TRACE + prompt + 4 + GlobalizationRules.ruleset + false + + + pdbonly + true + bin\ + TRACE + prompt + 4 + false + + + + False + ..\Dependencies\AjaxControlToolkit\AjaxControlToolkit.dll + + + False + ..\Dependencies\AjaxControlToolkit\AjaxMin.dll + + + False + Dependencies\AspNetPager.dll + + + False + ..\Dependencies\AjaxControlToolkit\HtmlAgilityPack.dll + + + + + + + + + + + + + + + + + + + + + ChangePassword.aspx + ASPXCodeBehind + + + ChangePassword.aspx + + + SignOut.aspx + ASPXCodeBehind + + + SignOut.aspx + + + True + True + FormResource.resx + + + True + True + Labels.resx + + + True + True + Questions.resx + + + True + True + Setup.resx + + + True + True + Titles.resx + + + True + True + Warnings.resx + + + ContentMaster.Master + ASPXCodeBehind + + + ContentMaster.Master + + + ConvertLeadToOpportunity.aspx + ASPXCodeBehind + + + ConvertLeadToOpportunity.aspx + + + Index.aspx + ASPXCodeBehind + + + Index.aspx + + + Lead.aspx + ASPXCodeBehind + + + Lead.aspx + + + LeadFollowup.aspx + ASPXCodeBehind + + + LeadFollowup.aspx + + + Opportunity.aspx + ASPXCodeBehind + + + Opportunity.aspx + + + OpportunityFollowup.aspx + ASPXCodeBehind + + + OpportunityFollowup.aspx + + + LeadSources.aspx + ASPXCodeBehind + + + LeadSources.aspx + + + LeadStatuses.aspx + ASPXCodeBehind + + + LeadStatuses.aspx + + + OpportunityStages.aspx + ASPXCodeBehind + + + OpportunityStages.aspx + + + Index.aspx + ASPXCodeBehind + + + Index.aspx + + + BankReconcilation.aspx + ASPXCodeBehind + + + BankReconcilation.aspx + + + GLAdvice.aspx + ASPXCodeBehind + + + GLAdvice.aspx + + + JournalVoucher.aspx + ASPXCodeBehind + + + JournalVoucher.aspx + + + Index.aspx + ASPXCodeBehind + + + Index.aspx + + + JournalVoucher.aspx + ASPXCodeBehind + + + JournalVoucher.aspx + + + AgeingSlabs.aspx + ASPXCodeBehind + + + AgeingSlabs.aspx + + + BankAccounts.aspx + ASPXCodeBehind + + + BankAccounts.aspx + + + BudgetAndTarget.aspx + ASPXCodeBehind + + + BudgetAndTarget.aspx + + + COA.aspx + ASPXCodeBehind + + + COA.aspx + + + CostCenters.aspx + ASPXCodeBehind + + + CostCenters.aspx + + + Currencies.aspx + ASPXCodeBehind + + + Currencies.aspx + + + ProductGLMapping.aspx + ASPXCodeBehind + + + ProductGLMapping.aspx + + + TaxSetup.aspx + ASPXCodeBehind + + + TaxSetup.aspx + + + TaxTypes.aspx + ASPXCodeBehind + + + TaxTypes.aspx + + + StandingInstructions.aspx + ASPXCodeBehind + + + StandingInstructions.aspx + + + TemplateTransaction.aspx + ASPXCodeBehind + + + TemplateTransaction.aspx + + + TransactionDocumentManager.aspx + ASPXCodeBehind + + + TransactionDocumentManager.aspx + + + UpdateExchangeRates.aspx + ASPXCodeBehind + + + UpdateExchangeRates.aspx + + + VoucherVerification.aspx + ASPXCodeBehind + + + VoucherVerification.aspx + + + ItemSelector.aspx + ASPXCodeBehind + + + ItemSelector.aspx + + + Global.asax + + + + Adjustment.aspx + ASPXCodeBehind + + + Adjustment.aspx + + + Index.aspx + ASPXCodeBehind + + + Index.aspx + + + Brands.aspx + ASPXCodeBehind + + + Brands.aspx + + + CostPrices.aspx + ASPXCodeBehind + + + CostPrices.aspx + + + CUOM.aspx + ASPXCodeBehind + + + CUOM.aspx + + + ItemGroups.aspx + ASPXCodeBehind + + + ItemGroups.aspx + + + Items.aspx + ASPXCodeBehind + + + Items.aspx + + + Parties.aspx + ASPXCodeBehind + + + Parties.aspx + + + PartiesPopup.aspx + ASPXCodeBehind + + + PartiesPopup.aspx + + + PartyTypes.aspx + ASPXCodeBehind + + + PartyTypes.aspx + + + SellingPrices.aspx + ASPXCodeBehind + + + SellingPrices.aspx + + + Shipper.aspx + ASPXCodeBehind + + + Shipper.aspx + + + ShippingAddresses.aspx + ASPXCodeBehind + + + ShippingAddresses.aspx + + + UOM.aspx + ASPXCodeBehind + + + UOM.aspx + + + Transfer.aspx + ASPXCodeBehind + + + Transfer.aspx + + + Index.aspx + ASPXCodeBehind + + + Index.aspx + + + WorkCenters.aspx + ASPXCodeBehind + + + WorkCenters.aspx + + + MenuMaster.Master + ASPXCodeBehind + + + MenuMaster.Master + + + AssignCashier.aspx + ASPXCodeBehind + + + AssignCashier.aspx + + + Index.aspx + ASPXCodeBehind + + + Index.aspx + + + Stores.aspx + ASPXCodeBehind + + + Stores.aspx + + + StoreTypes.aspx + ASPXCodeBehind + + + StoreTypes.aspx + + + + DirectPurchase.aspx + ASPXCodeBehind + + + DirectPurchase.aspx + + + DirectPurchaseInvoice.aspx + ASPXCodeBehind + + + DirectPurchaseInvoice.aspx + + + DirectPurchase.aspx + ASPXCodeBehind + + + DirectPurchase.aspx + + + GRN.aspx + ASPXCodeBehind + + + GRN.aspx + + + Index.aspx + ASPXCodeBehind + + + Index.aspx + + + Invoice.aspx + ASPXCodeBehind + + + Invoice.aspx + + + Order.aspx + ASPXCodeBehind + + + Order.aspx + + + Payment.aspx + ASPXCodeBehind + + + Payment.aspx + + + Return.aspx + ASPXCodeBehind + + + Return.aspx + + + MixERPMaster.Master + ASPXCodeBehind + + + MixERPMaster.Master + + + Header.aspx + ASPXCodeBehind + + + Header.aspx + + + ReportMaster.aspx + ASPXCodeBehind + + + ReportMaster.aspx + + + ReportViewer.aspx + ASPXCodeBehind + + + ReportViewer.aspx + + + RuntimeError.aspx + ASPXCodeBehind + + + RuntimeError.aspx + + + Quotation.aspx + ASPXCodeBehind + + + Quotation.aspx + + + ReportCustomerInvoice.aspx + ASPXCodeBehind + + + ReportCustomerInvoice.aspx + + + ReportDelivery.aspx + ASPXCodeBehind + + + ReportDelivery.aspx + + + DeliveryWithoutOrder.aspx + ASPXCodeBehind + + + DeliveryWithoutOrder.aspx + + + DirectSales.aspx + ASPXCodeBehind + + + DirectSales.aspx + + + ReportDeliveryNote.aspx + ASPXCodeBehind + + + ReportDeliveryNote.aspx + + + ReportDirectSalesInovice.aspx + ASPXCodeBehind + + + ReportDirectSalesInovice.aspx + + + DeliveryForOrder.aspx + ASPXCodeBehind + + + DeliveryForOrder.aspx + + + DeliveryWithoutOrder.aspx + ASPXCodeBehind + + + DeliveryWithoutOrder.aspx + + + DirectSales.aspx + ASPXCodeBehind + + + DirectSales.aspx + + + Quotation.aspx + ASPXCodeBehind + + + Quotation.aspx + + + Index.aspx + ASPXCodeBehind + + + Index.aspx + + + Invoice.aspx + ASPXCodeBehind + + + Invoice.aspx + + + Order.aspx + ASPXCodeBehind + + + Order.aspx + + + Quotation.aspx + ASPXCodeBehind + + + Quotation.aspx + + + Receipt.aspx + ASPXCodeBehind + + + Receipt.aspx + + + Return.aspx + ASPXCodeBehind + + + Return.aspx + + + AgentBonusSlabDetails.aspx + ASPXCodeBehind + + + AgentBonusSlabDetails.aspx + + + AgentBonusSlabs.aspx + ASPXCodeBehind + + + AgentBonusSlabs.aspx + + + Agents.aspx + ASPXCodeBehind + + + Agents.aspx + + + BonusSlabAssignment.aspx + ASPXCodeBehind + + + BonusSlabAssignment.aspx + + + AccountData.asmx + Component + + + ItemData.asmx + Component + + + PartyData.asmx + Component + + + Backup.aspx + ASPXCodeBehind + + + Backup.aspx + + + ChangePassword.aspx + ASPXCodeBehind + + + ChangePassword.aspx + + + DatabaseStatistics.aspx + ASPXCodeBehind + + + DatabaseStatistics.aspx + + + NewCompany.aspx + ASPXCodeBehind + + + NewCompany.aspx + + + Query.aspx + ASPXCodeBehind + + + Query.aspx + + + Restore.aspx + ASPXCodeBehind + + + Restore.aspx + + + CashRepositories.aspx + ASPXCodeBehind + + + CashRepositories.aspx + + + Counters.aspx + ASPXCodeBehind + + + Counters.aspx + + + Departments.aspx + ASPXCodeBehind + + + Departments.aspx + + + FiscalYear.aspx + ASPXCodeBehind + + + FiscalYear.aspx + + + Frequency.aspx + ASPXCodeBehind + + + Frequency.aspx + + + Index.aspx + ASPXCodeBehind + + + Index.aspx + + + Offices.aspx + ASPXCodeBehind + + + Offices.aspx + + + AutoVerification.aspx + ASPXCodeBehind + + + AutoVerification.aspx + + + GLAccess.aspx + ASPXCodeBehind + + + GLAccess.aspx + + + MenuAccess.aspx + ASPXCodeBehind + + + MenuAccess.aspx + + + Store.aspx + ASPXCodeBehind + + + Store.aspx + + + VoucherVerification.aspx + ASPXCodeBehind + + + VoucherVerification.aspx + + + Roles.aspx + ASPXCodeBehind + + + Roles.aspx + + + Users.aspx + ASPXCodeBehind + + + Users.aspx + + + SignIn.aspx + ASPXCodeBehind + + + SignIn.aspx + + + CurrencyExtender.ascx + ASPXCodeBehind + + + CurrencyExtender.ascx + + + DateTextBox.ascx + ASPXCodeBehind + + + DateTextBox.ascx + + + FormControl.ascx + ASPXCodeBehind + + + FormControl.ascx + + + ProductControl.ascx + ASPXCodeBehind + + + ProductControl.ascx + + + ProductViewControl.ascx + ASPXCodeBehind + + + ProductViewControl.ascx + + + ReportControl.ascx + ASPXCodeBehind + + + ReportControl.ascx + + + Header.ascx + ASPXCodeBehind + + + Header.ascx + + + TransactionChecklistControl.ascx + ASPXCodeBehind + + + TransactionChecklistControl.ascx + + + AlertsWidget.ascx + ASPXCodeBehind + + + AlertsWidget.ascx + + + CurrentOfficeSalesByMonthWidget.ascx + ASPXCodeBehind + + + CurrentOfficeSalesByMonthWidget.ascx + + + LinksWidget.ascx + ASPXCodeBehind + + + LinksWidget.ascx + + + OfficeInformationWidget.ascx + ASPXCodeBehind + + + OfficeInformationWidget.ascx + + + SalesByOfficeWidget.ascx + ASPXCodeBehind + + + SalesByOfficeWidget.ascx + + + TopSellingProductOfAllTimeCurrentWidget.ascx + ASPXCodeBehind + + + TopSellingProductOfAllTimeCurrentWidget.ascx + + + TopSellingProductOfAllTimetWidget.ascx + ASPXCodeBehind + + + TopSellingProductOfAllTimetWidget.ascx + + + WorkflowWidget.ascx + ASPXCodeBehind + + + WorkflowWidget.ascx + + + + + Dictionary.xml + + + Readme.txt + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Designer + + + Designer + + + Designer + + + Designer + + + Designer + + + Designer + + + Designer + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Designer + + + + Web.config + + + Web.config + + + + + + + + + + + + {81de04cf-7de9-42ff-8339-d05e2586dcba} + MixERP.Net.BusinessLayer + + + {d5a09c22-8f48-4fb2-a14d-c62c8c8fcec0} + MixERP.Net.Common + + + + + GlobalResourceProxyGenerator + FormResource.Designer.cs + Designer + + + + + GlobalResourceProxyGenerator + Labels.Designer.cs + Designer + + + + + GlobalResourceProxyGenerator + Questions.Designer.cs + + + + + GlobalResourceProxyGenerator + Titles.Designer.cs + Designer + + + + + GlobalResourceProxyGenerator + Warnings.Designer.cs + Designer + + + + + GlobalResourceProxyGenerator + Setup.Designer.cs + + + + 10.0 + $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) + + + true + + + Mix Open Foundation.snk + + + + + + + + + False + True + 34327 + / + http://localhost:50905/ + False + False + http://pes/ + False + + + + + + \ No newline at end of file diff --git a/MixERP.Net.FrontEnd/MixERP.Net.FrontEnd.csproj.user b/MixERP.Net.FrontEnd/MixERP.Net.FrontEnd.csproj.user new file mode 100644 index 000000000..8586d1c83 --- /dev/null +++ b/MixERP.Net.FrontEnd/MixERP.Net.FrontEnd.csproj.user @@ -0,0 +1,32 @@ + + + + ProjectFiles + MixERP + + + + + + + + CurrentPage + True + False + False + False + + + + + + + + + False + True + + + + + \ No newline at end of file diff --git a/MixERP.Net.FrontEnd/MixERP.Net.FrontEnd.licenseheader b/MixERP.Net.FrontEnd/MixERP.Net.FrontEnd.licenseheader new file mode 100644 index 000000000..d90ed1325 --- /dev/null +++ b/MixERP.Net.FrontEnd/MixERP.Net.FrontEnd.licenseheader @@ -0,0 +1,27 @@ +extensions: designer.cs generated.cs +extensions: .cs .cpp .h +/******************************************************************************** +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/. +***********************************************************************************/ +extensions: .aspx .ascx .Master +<%-- +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/. +--%> +extensions: .vb +'Sample license text. +extensions: .xml .config .xsd + \ No newline at end of file diff --git a/MixERP.Net.FrontEnd/MixERPMaster.Master b/MixERP.Net.FrontEnd/MixERPMaster.Master new file mode 100644 index 000000000..b890e0cad --- /dev/null +++ b/MixERP.Net.FrontEnd/MixERPMaster.Master @@ -0,0 +1,90 @@ +<%-- +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#" AutoEventWireup="true" CodeBehind="MixErpMaster.Master.cs" + Inherits="MixERP.Net.FrontEnd.MixErpMaster" %> + + + + + + + + + + + + MixErp® Beta + + + + + + + + + + + + +
+
+ + + + +
+ + +
+ +
+ + + +
+ + diff --git a/MixERP.Net.FrontEnd/MixERPMaster.Master.cs b/MixERP.Net.FrontEnd/MixERPMaster.Master.cs new file mode 100644 index 000000000..d89adb433 --- /dev/null +++ b/MixERP.Net.FrontEnd/MixERPMaster.Master.cs @@ -0,0 +1,44 @@ +/******************************************************************************** +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.Data; +using System.Linq; +using System.Web; +using System.Web.UI; +using System.Web.UI.WebControls; + +namespace MixERP.Net.FrontEnd +{ + public partial class MixErpMaster : System.Web.UI.MasterPage + { + protected void Page_Load(object sender, EventArgs e) + { + this.LoadMenu(); + } + + private void LoadMenu() + { + string menu = string.Empty; + + Collection collection = MixERP.Net.BusinessLayer.Core.Menu.GetMenuCollection(0, 0); + if(collection.Count > 0) + { + foreach(MixERP.Net.Common.Models.Core.Menu model in collection) + { + string menuText = model.MenuText; + string url = model.Url; + menu += string.Format(System.Threading.Thread.CurrentThread.CurrentCulture, "{1}", ResolveUrl(url), menuText); + } + } + + MenuLiteral.Text = menu; + } + } +} \ No newline at end of file diff --git a/MixERP.Net.FrontEnd/MixERPMaster.Master.designer.cs b/MixERP.Net.FrontEnd/MixERPMaster.Master.designer.cs new file mode 100644 index 000000000..c1b755135 --- /dev/null +++ b/MixERP.Net.FrontEnd/MixERPMaster.Master.designer.cs @@ -0,0 +1,78 @@ +//------------------------------------------------------------------------------ +// +// 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 MixErpMaster { + + /// + /// ScriptContentPlaceHolder control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.ContentPlaceHolder ScriptContentPlaceHolder; + + /// + /// StyleSheetContentPlaceHolder control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.ContentPlaceHolder StyleSheetContentPlaceHolder; + + /// + /// 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; + + /// + /// 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; + + /// + /// BodyContentPlaceHolder control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.ContentPlaceHolder BodyContentPlaceHolder; + + /// + /// SwallowSubmitButton control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Button SwallowSubmitButton; + + /// + /// BottomScriptContentPlaceHolder control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.ContentPlaceHolder BottomScriptContentPlaceHolder; + } +} diff --git a/MixERP.Net.FrontEnd/POS/AssignCashier.aspx b/MixERP.Net.FrontEnd/POS/AssignCashier.aspx new file mode 100644 index 000000000..3b8aee098 --- /dev/null +++ b/MixERP.Net.FrontEnd/POS/AssignCashier.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="AssignCashier.aspx.cs" Inherits="MixERP.Net.FrontEnd.POS.AssignCashier" %> + + + + + + + + diff --git a/MixERP.Net.FrontEnd/POS/AssignCashier.aspx.cs b/MixERP.Net.FrontEnd/POS/AssignCashier.aspx.cs new file mode 100644 index 000000000..547ba0b46 --- /dev/null +++ b/MixERP.Net.FrontEnd/POS/AssignCashier.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.POS +{ + public partial class AssignCashier : MixERP.Net.BusinessLayer.BasePageClass + { + protected void Page_Load(object sender, EventArgs e) + { + + } + } +} \ No newline at end of file diff --git a/MixERP.Net.FrontEnd/POS/AssignCashier.aspx.designer.cs b/MixERP.Net.FrontEnd/POS/AssignCashier.aspx.designer.cs new file mode 100644 index 000000000..dcc6d82bc --- /dev/null +++ b/MixERP.Net.FrontEnd/POS/AssignCashier.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.POS { + + + public partial class AssignCashier { + + protected System.Web.UI.WebControls.Content Content1; + } +} diff --git a/MixERP.Net.FrontEnd/POS/Index.aspx b/MixERP.Net.FrontEnd/POS/Index.aspx new file mode 100644 index 000000000..8c6b573c5 --- /dev/null +++ b/MixERP.Net.FrontEnd/POS/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.POS.Index" %> + + + + + +

+ Point of Sales +

+
+ +
+ + diff --git a/MixERP.Net.FrontEnd/POS/Index.aspx.cs b/MixERP.Net.FrontEnd/POS/Index.aspx.cs new file mode 100644 index 000000000..ffe0fea9d --- /dev/null +++ b/MixERP.Net.FrontEnd/POS/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.POS +{ + 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/POS/Index.aspx.designer.cs b/MixERP.Net.FrontEnd/POS/Index.aspx.designer.cs new file mode 100644 index 000000000..78e70d3b5 --- /dev/null +++ b/MixERP.Net.FrontEnd/POS/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.POS { + + + 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/POS/Setup/StoreTypes.aspx b/MixERP.Net.FrontEnd/POS/Setup/StoreTypes.aspx new file mode 100644 index 000000000..7c953063f --- /dev/null +++ b/MixERP.Net.FrontEnd/POS/Setup/StoreTypes.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="StoreTypes.aspx.cs" Inherits="MixERP.Net.FrontEnd.POS.Setup.StoreTypes" %> + + + + + + + + + diff --git a/MixERP.Net.FrontEnd/POS/Setup/StoreTypes.aspx.cs b/MixERP.Net.FrontEnd/POS/Setup/StoreTypes.aspx.cs new file mode 100644 index 000000000..3c8cccbe1 --- /dev/null +++ b/MixERP.Net.FrontEnd/POS/Setup/StoreTypes.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.POS.Setup +{ + public partial class StoreTypes : MixERP.Net.BusinessLayer.BasePageClass + { + protected void Page_Load(object sender, EventArgs e) + { + + } + } +} \ No newline at end of file diff --git a/MixERP.Net.FrontEnd/POS/Setup/StoreTypes.aspx.designer.cs b/MixERP.Net.FrontEnd/POS/Setup/StoreTypes.aspx.designer.cs new file mode 100644 index 000000000..212eb4d06 --- /dev/null +++ b/MixERP.Net.FrontEnd/POS/Setup/StoreTypes.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.POS.Setup { + + + public partial class StoreTypes { + + /// + /// StoreTypeForm control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::MixERP.Net.FrontEnd.UserControls.Forms.FormControl StoreTypeForm; + } +} diff --git a/MixERP.Net.FrontEnd/POS/Setup/Stores.aspx b/MixERP.Net.FrontEnd/POS/Setup/Stores.aspx new file mode 100644 index 000000000..0e7598d02 --- /dev/null +++ b/MixERP.Net.FrontEnd/POS/Setup/Stores.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="Stores.aspx.cs" Inherits="MixERP.Net.FrontEnd.POS.Setup.Stores" %> + + + + + + + + + diff --git a/MixERP.Net.FrontEnd/POS/Setup/Stores.aspx.cs b/MixERP.Net.FrontEnd/POS/Setup/Stores.aspx.cs new file mode 100644 index 000000000..bb7bac857 --- /dev/null +++ b/MixERP.Net.FrontEnd/POS/Setup/Stores.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.POS.Setup +{ + public partial class Stores : MixERP.Net.BusinessLayer.BasePageClass + { + protected void Page_Load(object sender, EventArgs e) + { + + } + } +} \ No newline at end of file diff --git a/MixERP.Net.FrontEnd/POS/Setup/Stores.aspx.designer.cs b/MixERP.Net.FrontEnd/POS/Setup/Stores.aspx.designer.cs new file mode 100644 index 000000000..2cf895fc2 --- /dev/null +++ b/MixERP.Net.FrontEnd/POS/Setup/Stores.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.POS.Setup { + + + public partial class Stores { + + /// + /// StoreForm control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::MixERP.Net.FrontEnd.UserControls.Forms.FormControl StoreForm; + } +} diff --git a/MixERP.Net.FrontEnd/Properties/AssemblyInfo.cs b/MixERP.Net.FrontEnd/Properties/AssemblyInfo.cs new file mode 100644 index 000000000..89de67095 --- /dev/null +++ b/MixERP.Net.FrontEnd/Properties/AssemblyInfo.cs @@ -0,0 +1,42 @@ +/******************************************************************************** +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.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("MixERP.Net.FrontEnd")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("MixERP.Net.FrontEnd")] +[assembly: AssemblyCopyright("Copyright © 2013")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("96ca1915-0b12-4741-ba8d-4964cb148f6d")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Revision and Build Numbers +// by using the '*' as shown below: +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/MixERP.Net.FrontEnd/Properties/PublishProfiles/MixERP.pubxml b/MixERP.Net.FrontEnd/Properties/PublishProfiles/MixERP.pubxml new file mode 100644 index 000000000..2ffcc40a6 --- /dev/null +++ b/MixERP.Net.FrontEnd/Properties/PublishProfiles/MixERP.pubxml @@ -0,0 +1,16 @@ + + + + + FileSystem + Release + Any CPU + + False + C:\Users\Binod\Desktop\mixerp + False + + \ No newline at end of file diff --git a/MixERP.Net.FrontEnd/Properties/PublishProfiles/MixERP.pubxml.user b/MixERP.Net.FrontEnd/Properties/PublishProfiles/MixERP.pubxml.user new file mode 100644 index 000000000..6fe10480a --- /dev/null +++ b/MixERP.Net.FrontEnd/Properties/PublishProfiles/MixERP.pubxml.user @@ -0,0 +1,2172 @@ + + + + + + + + + 08/11/2013 16:12:45 + + + 08/11/2013 16:12:45 + + + 08/11/2013 16:12:46 + + + 08/11/2013 16:12:46 + + + 08/11/2013 16:12:47 + + + 09/03/2013 22:03:28 + + + 08/13/2013 12:23:33 + + + 08/12/2013 03:10:28 + + + 08/11/2013 16:06:18 + + + 09/06/2013 15:39:53 + + + 08/13/2013 11:54:46 + + + 08/17/2013 00:30:04 + + + 08/01/2013 02:47:00 + + + 08/19/2013 16:40:53 + + + 08/19/2013 16:40:51 + + + 08/19/2013 16:40:53 + + + 07/14/2013 01:51:27 + + + 08/19/2013 16:40:53 + + + 08/19/2013 16:40:53 + + + 08/19/2013 16:40:53 + + + 08/19/2013 16:40:53 + + + 08/19/2013 16:40:53 + + + 08/19/2013 16:40:53 + + + 07/24/2013 16:44:14 + + + 08/19/2013 16:40:53 + + + 08/04/2013 02:23:57 + + + 08/19/2013 16:40:53 + + + 08/19/2013 16:40:53 + + + 10/11/2012 07:48:20 + + + 09/07/2013 22:41:44 + + + 09/07/2013 22:41:43 + + + 09/07/2013 22:41:43 + + + 09/07/2013 22:41:45 + + + 08/19/2013 16:39:22 + + + 08/19/2013 16:40:53 + + + 08/19/2013 16:39:22 + + + 08/30/2013 14:30:55 + + + 08/19/2013 16:40:53 + + + 08/19/2013 16:40:53 + + + 07/16/2013 01:27:08 + + + 08/19/2013 16:40:53 + + + 08/19/2013 16:40:53 + + + 08/19/2013 16:40:53 + + + 08/12/2013 02:11:28 + + + 08/11/2013 16:12:48 + + + 09/07/2013 18:20:25 + + + 08/11/2013 16:12:49 + + + 08/11/2013 16:12:49 + + + 08/11/2013 16:12:50 + + + 08/11/2013 16:12:50 + + + 08/17/2013 00:13:03 + + + 08/17/2013 00:12:59 + + + 08/17/2013 00:12:54 + + + 08/21/2013 19:35:49 + + + 07/18/2013 18:54:10 + + + 08/09/2013 02:30:28 + + + 09/03/2013 22:40:57 + + + 08/09/2013 02:16:20 + + + 09/05/2013 14:57:13 + + + 09/03/2013 22:31:49 + + + 08/26/2013 21:20:59 + + + 08/22/2013 12:15:59 + + + 07/14/2013 02:42:51 + + + 08/01/2013 20:27:32 + + + 07/27/2013 02:49:28 + + + 07/31/2013 18:11:58 + + + 07/14/2013 01:51:27 + + + 07/14/2013 01:51:27 + + + 07/10/2013 23:08:54 + + + 08/11/2013 16:12:53 + + + 08/30/2013 19:45:51 + + + 08/14/2013 00:09:08 + + + 09/07/2013 18:20:29 + + + 08/22/2013 20:14:52 + + + 08/11/2013 17:35:33 + + + 08/16/2013 23:43:23 + + + 08/11/2013 16:15:07 + + + 08/02/2013 01:36:10 + + + 08/16/2013 23:45:45 + + + 08/12/2013 02:42:31 + + + 08/12/2013 02:42:50 + + + 08/11/2013 16:15:10 + + + 07/15/2013 13:46:52 + + + 07/15/2013 13:44:34 + + + 08/16/2013 23:47:03 + + + 08/17/2013 00:12:45 + + + 08/11/2013 16:15:12 + + + 08/11/2013 16:15:13 + + + 08/11/2013 16:15:13 + + + 08/11/2013 16:15:14 + + + 08/11/2013 16:15:14 + + + 08/18/2013 14:53:32 + + + 08/02/2013 01:36:12 + + + 08/30/2013 19:33:17 + + + 08/11/2013 16:15:15 + + + 09/07/2013 18:20:33 + + + 08/17/2013 00:12:39 + + + 08/17/2013 00:12:33 + + + 08/16/2013 23:52:53 + + + 08/17/2013 00:14:17 + + + 08/17/2013 00:13:14 + + + 08/26/2013 23:13:44 + + + 08/26/2013 23:16:01 + + + 08/17/2013 00:12:23 + + + 08/17/2013 00:14:17 + + + 08/17/2013 00:00:30 + + + 08/26/2013 21:45:02 + + + 08/12/2013 02:45:23 + + + 08/11/2013 16:15:22 + + + 09/07/2013 18:20:36 + + + 08/17/2013 00:01:38 + + + 08/16/2013 23:00:00 + + + 08/11/2013 16:23:19 + + + 08/11/2013 16:20:20 + + + 09/07/2013 22:16:13 + + + 08/19/2013 16:41:04 + + + 08/02/2013 02:52:14 + + + 08/11/2013 16:15:25 + + + 09/07/2013 18:21:44 + + + 08/17/2013 00:02:22 + + + 08/17/2013 00:12:16 + + + 08/14/2013 00:34:36 + + + 08/30/2013 19:46:03 + + + 08/24/2013 13:13:53 + + + 08/21/2013 19:55:16 + + + 09/07/2013 18:21:07 + + + 08/11/2013 16:15:29 + + + 08/22/2013 12:21:50 + + + 08/11/2013 16:15:30 + + + 08/11/2013 16:15:31 + + + 08/02/2013 01:36:16 + + + 08/13/2013 15:48:55 + + + 08/11/2013 16:24:54 + + + 08/04/2013 03:56:39 + + + 08/02/2013 01:36:16 + + + 08/16/2013 16:38:46 + + + 09/07/2013 18:22:36 + + + 08/13/2013 23:58:52 + + + 08/30/2013 14:28:03 + + + 08/14/2013 00:21:16 + + + 08/22/2013 21:57:29 + + + 08/11/2013 16:15:33 + + + 08/22/2013 21:56:44 + + + 08/11/2013 16:15:33 + + + 08/24/2013 13:09:43 + + + 08/30/2013 14:28:03 + + + 08/14/2013 00:21:16 + + + 08/22/2013 21:57:29 + + + 08/11/2013 16:15:33 + + + 08/22/2013 21:56:44 + + + 08/11/2013 16:15:33 + + + 08/24/2013 13:09:43 + + + 07/31/2013 22:02:29 + + + 08/02/2013 04:41:42 + + + 07/25/2013 15:05:28 + + + 07/31/2013 21:45:52 + + + 07/31/2013 21:47:35 + + + 07/31/2013 21:48:15 + + + 07/31/2013 21:46:38 + + + 07/31/2013 22:01:59 + + + 08/26/2013 20:03:40 + + + 08/30/2013 21:32:41 + + + 08/27/2013 21:24:05 + + + 09/07/2013 22:26:14 + + + 08/27/2013 21:33:26 + + + 08/27/2013 21:33:26 + + + 08/18/2013 21:52:26 + + + 08/18/2013 21:52:26 + + + 08/18/2013 21:52:26 + + + 08/18/2013 21:52:47 + + + 08/18/2013 21:52:47 + + + 08/18/2013 21:52:47 + + + 08/18/2013 21:52:47 + + + 08/18/2013 21:52:47 + + + 08/18/2013 21:53:21 + + + 08/18/2013 21:53:21 + + + 08/18/2013 21:53:21 + + + 08/18/2013 21:53:21 + + + 08/18/2013 21:53:21 + + + 08/18/2013 21:53:21 + + + 08/18/2013 21:53:21 + + + 08/18/2013 21:53:21 + + + 08/18/2013 21:53:21 + + + 08/18/2013 21:53:21 + + + 08/18/2013 21:53:21 + + + 08/18/2013 21:53:21 + + + 08/18/2013 21:53:21 + + + 08/18/2013 21:53:21 + + + 08/18/2013 21:53:21 + + + 08/18/2013 21:53:21 + + + 08/18/2013 21:53:21 + + + 08/18/2013 21:53:21 + + + 08/18/2013 21:53:21 + + + 08/18/2013 21:53:21 + + + 08/18/2013 21:53:21 + + + 08/18/2013 21:53:21 + + + 08/18/2013 21:53:21 + + + 08/18/2013 21:53:21 + + + 08/18/2013 21:53:21 + + + 08/18/2013 21:53:21 + + + 08/18/2013 21:53:21 + + + 08/18/2013 21:53:21 + + + 08/18/2013 21:53:21 + + + 08/18/2013 21:53:21 + + + 08/18/2013 21:53:21 + + + 08/18/2013 21:53:21 + + + 08/18/2013 21:53:21 + + + 08/18/2013 21:53:21 + + + 08/18/2013 21:53:21 + + + 08/18/2013 21:53:21 + + + 08/18/2013 21:53:21 + + + 08/18/2013 21:53:21 + + + 08/18/2013 21:53:21 + + + 08/18/2013 21:53:21 + + + 08/18/2013 21:53:21 + + + 08/18/2013 21:53:21 + + + 08/18/2013 21:53:21 + + + 08/18/2013 21:53:21 + + + 08/18/2013 21:53:21 + + + 08/18/2013 21:53:21 + + + 08/18/2013 21:53:21 + + + 08/18/2013 21:53:21 + + + 08/18/2013 21:53:21 + + + 08/18/2013 21:53:21 + + + 08/18/2013 21:53:21 + + + 08/18/2013 21:53:21 + + + 08/18/2013 21:53:21 + + + 08/18/2013 21:53:21 + + + 08/18/2013 21:53:21 + + + 08/18/2013 21:53:21 + + + 08/18/2013 21:53:21 + + + 08/18/2013 21:53:21 + + + 08/18/2013 21:53:21 + + + 08/18/2013 21:53:21 + + + 08/18/2013 21:53:21 + + + 08/18/2013 21:53:21 + + + 08/18/2013 21:53:21 + + + 08/18/2013 21:53:21 + + + 08/18/2013 21:53:21 + + + 08/18/2013 21:53:21 + + + 08/18/2013 21:53:21 + + + 08/18/2013 21:53:21 + + + 08/18/2013 21:53:21 + + + 08/18/2013 21:53:21 + + + 08/18/2013 21:53:21 + + + 08/18/2013 21:53:21 + + + 08/18/2013 21:53:21 + + + 08/18/2013 21:53:21 + + + 08/18/2013 21:53:21 + + + 08/18/2013 21:53:20 + + + 08/18/2013 21:53:20 + + + 08/18/2013 21:53:20 + + + 08/18/2013 21:53:20 + + + 08/18/2013 21:53:20 + + + 08/18/2013 21:53:20 + + + 08/18/2013 21:53:20 + + + 08/18/2013 21:53:20 + + + 08/18/2013 21:53:21 + + + 08/18/2013 21:53:21 + + + 08/18/2013 21:53:21 + + + 08/18/2013 21:53:21 + + + 08/18/2013 21:53:21 + + + 08/18/2013 21:53:21 + + + 08/18/2013 21:53:21 + + + 08/18/2013 21:53:21 + + + 08/18/2013 21:53:21 + + + 08/18/2013 21:53:21 + + + 08/18/2013 21:53:21 + + + 08/18/2013 21:53:21 + + + 08/18/2013 21:53:21 + + + 08/18/2013 21:53:21 + + + 08/18/2013 21:53:21 + + + 08/18/2013 21:53:21 + + + 08/18/2013 21:53:21 + + + 08/18/2013 21:53:21 + + + 08/18/2013 21:53:21 + + + 08/18/2013 21:59:24 + + + 08/18/2013 21:53:21 + + + 08/18/2013 21:53:21 + + + 08/18/2013 21:53:21 + + + 08/18/2013 21:53:21 + + + 08/18/2013 21:53:21 + + + 08/18/2013 21:53:21 + + + 08/18/2013 21:53:21 + + + 08/18/2013 21:53:21 + + + 08/18/2013 21:53:21 + + + 08/18/2013 21:53:21 + + + 08/18/2013 21:53:21 + + + 08/18/2013 21:53:21 + + + 08/18/2013 21:53:21 + + + 08/18/2013 21:53:21 + + + 08/18/2013 21:53:21 + + + 07/31/2013 22:02:29 + + + 08/02/2013 04:41:42 + + + 08/04/2013 16:31:03 + + + 07/25/2013 15:05:28 + + + 07/31/2013 21:45:52 + + + 07/31/2013 21:47:35 + + + 08/03/2013 22:29:58 + + + 07/31/2013 21:48:15 + + + 07/31/2013 21:46:38 + + + 08/17/2013 00:24:30 + + + 07/31/2013 22:01:59 + + + 08/12/2013 15:16:18 + + + 08/20/2013 00:17:39 + + + 09/07/2013 18:22:05 + + + 08/13/2013 23:59:27 + + + 08/22/2013 22:08:00 + + + 08/22/2013 22:00:09 + + + 08/14/2013 00:17:06 + + + 08/30/2013 19:50:33 + + + 08/30/2013 19:46:13 + + + 08/30/2013 19:46:27 + + + 08/30/2013 19:46:20 + + + 08/30/2013 19:46:27 + + + 08/17/2013 01:02:31 + + + 08/22/2013 12:39:35 + + + 08/22/2013 13:24:29 + + + 08/23/2013 13:09:28 + + + 08/25/2013 22:37:51 + + + 09/07/2013 18:21:10 + + + 09/05/2013 00:24:13 + + + 08/22/2013 12:20:11 + + + 09/06/2013 15:39:55 + + + 08/11/2013 16:15:42 + + + 08/11/2013 16:15:43 + + + 08/17/2013 00:03:27 + + + 08/17/2013 00:04:06 + + + 08/17/2013 00:05:39 + + + 08/17/2013 00:06:21 + + + 08/02/2013 01:36:19 + + + 08/02/2013 01:36:19 + + + 07/14/2013 01:51:29 + + + 07/14/2013 01:51:29 + + + 07/14/2013 01:51:29 + + + 07/14/2013 01:51:29 + + + 07/14/2013 01:51:29 + + + 07/14/2013 01:51:29 + + + 07/14/2013 01:51:29 + + + 07/14/2013 01:51:29 + + + 07/14/2013 01:51:29 + + + 07/14/2013 01:51:29 + + + 07/14/2013 01:51:29 + + + 07/14/2013 01:51:29 + + + 07/14/2013 01:51:29 + + + 07/14/2013 01:51:29 + + + 07/14/2013 01:51:29 + + + 07/14/2013 01:51:29 + + + 07/14/2013 01:51:29 + + + 07/14/2013 01:51:29 + + + 07/14/2013 01:51:29 + + + 07/14/2013 01:51:30 + + + 07/14/2013 01:51:30 + + + 07/14/2013 01:51:30 + + + 07/14/2013 01:51:30 + + + 07/14/2013 01:51:30 + + + 07/14/2013 01:51:30 + + + 07/14/2013 01:51:30 + + + 07/14/2013 01:51:30 + + + 07/14/2013 01:51:30 + + + 07/14/2013 01:51:30 + + + 07/14/2013 15:24:39 + + + 07/14/2013 01:51:30 + + + 07/14/2013 01:51:30 + + + 07/14/2013 01:51:30 + + + 07/14/2013 01:51:30 + + + 07/14/2013 01:51:30 + + + 07/14/2013 01:51:30 + + + 07/14/2013 01:51:30 + + + 07/14/2013 01:51:30 + + + 07/14/2013 01:51:30 + + + 07/14/2013 01:51:30 + + + 07/14/2013 01:51:30 + + + 07/14/2013 01:51:30 + + + 07/14/2013 01:51:30 + + + 07/14/2013 01:51:30 + + + 07/14/2013 01:51:30 + + + 07/14/2013 01:51:30 + + + 07/14/2013 01:51:30 + + + 07/14/2013 01:51:30 + + + 07/14/2013 01:51:30 + + + 07/14/2013 01:51:30 + + + 08/11/2013 16:07:06 + + + 08/11/2013 16:07:07 + + + 08/11/2013 16:07:07 + + + 08/11/2013 16:07:07 + + + 08/11/2013 16:07:07 + + + 08/11/2013 16:07:07 + + + 08/11/2013 16:07:07 + + + 08/11/2013 16:07:07 + + + 08/11/2013 16:07:07 + + + 08/11/2013 16:07:07 + + + 08/11/2013 16:07:08 + + + 08/11/2013 16:07:08 + + + 08/11/2013 16:07:08 + + + 08/11/2013 16:07:08 + + + 08/11/2013 16:07:08 + + + 08/11/2013 16:07:08 + + + 08/11/2013 16:07:08 + + + 08/11/2013 16:07:08 + + + 08/11/2013 16:07:08 + + + 08/11/2013 16:07:08 + + + 08/11/2013 16:07:09 + + + 08/11/2013 16:07:09 + + + 08/11/2013 16:07:09 + + + 08/11/2013 16:07:09 + + + 08/11/2013 16:07:09 + + + 08/11/2013 16:07:09 + + + 08/11/2013 16:07:09 + + + 08/11/2013 16:07:10 + + + 08/11/2013 16:07:10 + + + 08/11/2013 16:07:10 + + + 08/11/2013 16:07:10 + + + 08/11/2013 16:07:10 + + + 08/11/2013 16:07:10 + + + 08/11/2013 16:07:10 + + + 07/14/2013 01:51:31 + + + 07/14/2013 01:51:31 + + + 08/11/2013 16:07:10 + + + 07/14/2013 01:51:31 + + + 08/11/2013 16:07:11 + + + 08/11/2013 16:07:11 + + + 08/11/2013 16:07:11 + + + 08/11/2013 16:07:11 + + + 08/11/2013 16:07:11 + + + 08/11/2013 16:07:11 + + + 08/11/2013 16:07:11 + + + 08/11/2013 16:07:11 + + + 08/11/2013 16:07:11 + + + 07/14/2013 01:51:31 + + + 07/14/2013 01:51:31 + + + 07/14/2013 01:51:31 + + + 07/14/2013 01:51:31 + + + 08/11/2013 21:54:01 + + + 07/14/2013 01:51:32 + + + 07/14/2013 01:51:32 + + + 08/11/2013 16:07:12 + + + 07/14/2013 01:51:32 + + + 08/11/2013 16:07:12 + + + 07/14/2013 01:51:32 + + + 08/11/2013 16:07:13 + + + 08/11/2013 16:07:13 + + + 07/14/2013 01:51:32 + + + 08/11/2013 16:07:13 + + + 07/14/2013 01:51:32 + + + 08/11/2013 16:07:13 + + + 08/11/2013 21:54:01 + + + 08/11/2013 16:07:13 + + + 07/14/2013 01:51:32 + + + 07/14/2013 01:51:32 + + + 08/11/2013 16:07:14 + + + 08/11/2013 21:54:01 + + + 08/11/2013 16:07:14 + + + 08/11/2013 16:07:14 + + + 07/14/2013 01:51:32 + + + 07/14/2013 01:51:32 + + + 07/14/2013 01:51:32 + + + 08/11/2013 16:07:14 + + + 07/14/2013 01:51:33 + + + 08/11/2013 16:07:15 + + + 07/14/2013 01:51:33 + + + 08/11/2013 16:07:15 + + + 07/14/2013 01:51:33 + + + 08/11/2013 16:07:15 + + + 07/14/2013 01:51:33 + + + 08/11/2013 16:07:15 + + + 07/14/2013 01:51:33 + + + 08/11/2013 16:07:15 + + + 07/14/2013 01:51:33 + + + 07/14/2013 01:51:33 + + + 08/11/2013 16:07:16 + + + 07/14/2013 01:51:33 + + + 08/11/2013 16:07:16 + + + 07/14/2013 01:51:33 + + + 08/11/2013 16:07:16 + + + 07/14/2013 01:51:33 + + + 07/14/2013 01:51:33 + + + 08/11/2013 16:07:16 + + + 08/11/2013 21:54:01 + + + 08/11/2013 16:07:17 + + + 07/14/2013 01:51:33 + + + 08/11/2013 16:07:17 + + + 07/14/2013 01:51:33 + + + 08/11/2013 21:54:01 + + + 07/14/2013 01:51:33 + + + 08/11/2013 16:07:17 + + + 08/11/2013 16:07:17 + + + 07/14/2013 01:51:33 + + + 08/11/2013 16:07:18 + + + 08/11/2013 16:07:18 + + + 07/14/2013 01:51:33 + + + 08/11/2013 16:07:18 + + + 07/14/2013 01:51:33 + + + 08/11/2013 16:07:18 + + + 07/14/2013 01:51:33 + + + 07/14/2013 01:51:33 + + + 07/14/2013 01:51:33 + + + 08/11/2013 16:07:18 + + + 07/14/2013 01:51:34 + + + 08/11/2013 16:07:18 + + + 07/14/2013 01:51:34 + + + 07/14/2013 01:51:34 + + + 07/14/2013 01:51:34 + + + 08/11/2013 16:07:19 + + + 07/14/2013 01:51:34 + + + 08/11/2013 16:07:19 + + + 07/14/2013 01:51:34 + + + 08/11/2013 16:07:19 + + + 07/14/2013 01:51:34 + + + 08/11/2013 16:07:19 + + + 07/14/2013 01:51:34 + + + 07/14/2013 01:51:34 + + + 08/11/2013 16:07:20 + + + 07/14/2013 01:51:34 + + + 07/14/2013 01:51:34 + + + 08/11/2013 16:07:20 + + + 07/14/2013 01:51:34 + + + 08/11/2013 16:07:20 + + + 08/11/2013 21:54:02 + + + 08/11/2013 16:07:20 + + + 07/14/2013 01:51:34 + + + 08/11/2013 16:07:21 + + + 07/14/2013 01:51:34 + + + 08/11/2013 21:54:02 + + + 08/11/2013 16:07:21 + + + 07/14/2013 01:51:34 + + + 08/11/2013 16:07:21 + + + 07/14/2013 01:51:34 + + + 07/14/2013 01:51:34 + + + 07/14/2013 01:51:34 + + + 08/11/2013 16:07:21 + + + 08/11/2013 16:07:22 + + + 07/14/2013 01:51:34 + + + 07/14/2013 01:51:34 + + + 08/11/2013 16:07:22 + + + 07/14/2013 01:51:34 + + + 07/14/2013 01:51:34 + + + 08/11/2013 16:07:22 + + + 07/14/2013 01:51:34 + + + 07/14/2013 01:51:34 + + + 08/11/2013 16:07:22 + + + 07/14/2013 01:51:34 + + + 08/11/2013 16:07:22 + + + 08/11/2013 21:54:02 + + + 08/11/2013 16:07:23 + + + 07/14/2013 01:51:35 + + + 08/11/2013 16:07:23 + + + 07/14/2013 01:51:35 + + + 08/11/2013 16:07:23 + + + 07/14/2013 01:51:35 + + + 07/14/2013 15:25:05 + + + 08/11/2013 16:07:23 + + + 07/14/2013 01:51:35 + + + 08/11/2013 16:07:24 + + + 07/14/2013 01:51:35 + + + 08/11/2013 16:07:24 + + + 07/14/2013 01:51:35 + + + 08/11/2013 16:07:24 + + + 07/14/2013 01:51:35 + + + 08/11/2013 16:07:24 + + + 07/14/2013 01:51:35 + + + 07/14/2013 01:51:35 + + + 08/11/2013 16:07:25 + + + 07/14/2013 01:51:35 + + + 08/11/2013 16:07:25 + + + 07/14/2013 01:51:35 + + + 07/14/2013 15:25:08 + + + 07/14/2013 01:51:35 + + + 07/14/2013 01:51:35 + + + 07/14/2013 01:51:35 + + + 08/11/2013 16:07:26 + + + 07/14/2013 01:51:35 + + + 07/14/2013 01:51:35 + + + 07/14/2013 01:51:35 + + + 07/14/2013 01:51:35 + + + 08/11/2013 16:07:26 + + + 07/14/2013 01:51:35 + + + 08/11/2013 16:07:26 + + + 07/14/2013 01:51:35 + + + 08/11/2013 16:07:26 + + + 07/14/2013 01:51:35 + + + 08/11/2013 16:07:27 + + + 07/14/2013 01:51:35 + + + 08/11/2013 16:07:27 + + + 07/14/2013 01:51:35 + + + 07/14/2013 01:51:35 + + + 07/14/2013 15:25:10 + + + 08/11/2013 16:07:27 + + + 07/14/2013 01:51:35 + + + 08/11/2013 16:07:27 + + + 07/14/2013 01:51:35 + + + 07/14/2013 01:51:36 + + + 07/14/2013 01:51:36 + + + 07/14/2013 01:51:36 + + + 07/14/2013 01:51:36 + + + 07/14/2013 01:51:36 + + + 07/14/2013 01:51:36 + + + 08/11/2013 16:07:28 + + + 07/14/2013 15:25:13 + + + 07/14/2013 01:51:36 + + + 07/14/2013 15:25:13 + + + 07/14/2013 01:51:36 + + + 07/14/2013 01:51:36 + + + 07/14/2013 01:51:36 + + + 07/14/2013 01:51:36 + + + 07/14/2013 01:51:36 + + + 07/14/2013 01:51:36 + + + 07/14/2013 01:51:36 + + + 07/14/2013 01:51:36 + + + 07/14/2013 01:51:36 + + + 07/14/2013 01:51:36 + + + 07/14/2013 01:51:36 + + + 07/14/2013 01:51:36 + + + 07/14/2013 01:51:36 + + + 07/14/2013 01:51:36 + + + 07/14/2013 01:51:36 + + + 07/14/2013 01:51:36 + + + 07/14/2013 01:51:36 + + + 07/14/2013 01:51:36 + + + 07/14/2013 01:51:37 + + + 07/14/2013 01:51:37 + + + 07/14/2013 01:51:37 + + + 07/14/2013 01:51:37 + + + 07/14/2013 01:51:37 + + + 07/14/2013 01:51:37 + + + 07/14/2013 01:51:37 + + + 07/14/2013 15:37:10 + + + 07/14/2013 15:25:17 + + + 07/14/2013 15:25:17 + + + 08/16/2013 22:55:00 + + + 08/16/2013 22:51:51 + + + 08/16/2013 22:51:51 + + + 08/16/2013 22:51:51 + + + 08/16/2013 22:51:51 + + + 08/16/2013 22:51:51 + + + 08/16/2013 22:51:51 + + + 08/16/2013 22:51:51 + + + 08/16/2013 22:51:51 + + + 08/16/2013 22:51:51 + + + 08/16/2013 22:51:51 + + + 08/16/2013 22:51:51 + + + 08/16/2013 22:51:51 + + + 08/16/2013 22:51:51 + + + 08/16/2013 22:51:51 + + + 08/16/2013 22:51:51 + + + 08/16/2013 22:51:52 + + + 08/16/2013 22:51:52 + + + 08/16/2013 22:51:52 + + + 08/16/2013 22:51:52 + + + 08/16/2013 22:51:52 + + + 08/16/2013 22:51:52 + + + 08/16/2013 22:51:52 + + + 08/16/2013 22:51:52 + + + 08/16/2013 22:51:52 + + + 08/16/2013 22:51:52 + + + 08/16/2013 22:51:52 + + + 08/16/2013 22:51:52 + + + 08/16/2013 22:53:19 + + + 08/16/2013 22:53:20 + + + 08/16/2013 22:52:09 + + + 09/07/2013 21:46:49 + + + 08/20/2013 00:36:20 + + + 08/19/2013 22:59:21 + + + 08/19/2013 22:59:21 + + + 07/14/2013 01:51:37 + + + 09/07/2013 18:31:50 + + + 09/07/2013 22:33:18 + + + 08/11/2013 16:07:31 + + + 08/11/2013 01:20:50 + + + 08/02/2013 01:36:20 + + + 08/30/2013 21:02:09 + + + 08/11/2013 16:16:07 + + + 08/11/2013 16:16:08 + + + 08/12/2013 02:49:23 + + + 08/11/2013 16:16:10 + + + 08/14/2013 00:01:35 + + + 08/11/2013 16:16:12 + + + 08/17/2013 00:14:12 + + + 08/17/2013 00:14:09 + + + 08/17/2013 00:13:57 + + + 08/11/2013 16:24:55 + + + 08/17/2013 00:09:46 + + + 09/07/2013 18:21:14 + + + 08/17/2013 00:11:35 + + + 08/16/2013 23:40:38 + + + 08/11/2013 16:16:20 + + + 08/11/2013 16:16:21 + + + 08/11/2013 16:16:21 + + + 08/17/2013 00:12:04 + + + 08/17/2013 00:13:51 + + + 08/11/2013 16:16:24 + + + 08/12/2013 03:11:09 + + + 07/14/2013 20:38:05 + + + 08/02/2013 00:51:41 + + + 07/15/2013 03:39:52 + + + 07/14/2013 03:06:06 + + + 07/14/2013 01:51:37 + + + 09/07/2013 21:27:29 + + + 07/14/2013 03:10:00 + + + 07/14/2013 03:06:06 + + + 07/14/2013 03:10:00 + + + 07/14/2013 01:51:37 + + + 08/11/2013 16:16:28 + + + 08/23/2013 12:55:32 + + + 09/07/2013 20:51:29 + + + 08/26/2013 23:20:42 + + + 09/07/2013 19:21:48 + + + 09/07/2013 20:47:28 + + + 09/07/2013 18:19:29 + + + 08/11/2013 16:16:35 + + + 09/07/2013 20:23:10 + + + 08/21/2013 19:33:26 + + + 08/21/2013 19:32:19 + + + 08/21/2013 19:33:47 + + + 08/21/2013 19:33:13 + + + 08/21/2013 19:31:47 + + + 08/21/2013 19:34:42 + + + 08/21/2013 19:34:24 + + + 08/21/2013 19:32:53 + + + 09/07/2013 22:41:46 + + + \ No newline at end of file diff --git a/MixERP.Net.FrontEnd/Purchase/Confirmation/DirectPurchase.aspx b/MixERP.Net.FrontEnd/Purchase/Confirmation/DirectPurchase.aspx new file mode 100644 index 000000000..d090c0808 --- /dev/null +++ b/MixERP.Net.FrontEnd/Purchase/Confirmation/DirectPurchase.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="DirectPurchase.aspx.cs" Inherits="MixERP.Net.FrontEnd.Purchase.Confirmation.DirectPurchase" %> + + + + + + + + + diff --git a/MixERP.Net.FrontEnd/Purchase/Confirmation/DirectPurchase.aspx.cs b/MixERP.Net.FrontEnd/Purchase/Confirmation/DirectPurchase.aspx.cs new file mode 100644 index 000000000..f670b9fa4 --- /dev/null +++ b/MixERP.Net.FrontEnd/Purchase/Confirmation/DirectPurchase.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.Confirmation +{ + public partial class DirectPurchase : 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/Confirmation/DirectPurchase.aspx.designer.cs b/MixERP.Net.FrontEnd/Purchase/Confirmation/DirectPurchase.aspx.designer.cs new file mode 100644 index 000000000..b7389c881 --- /dev/null +++ b/MixERP.Net.FrontEnd/Purchase/Confirmation/DirectPurchase.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.Confirmation { + + + public partial class DirectPurchase { + + protected System.Web.UI.WebControls.Content Content1; + } +} diff --git a/MixERP.Net.FrontEnd/Purchase/Confirmation/DirectPurchaseInvoice.aspx b/MixERP.Net.FrontEnd/Purchase/Confirmation/DirectPurchaseInvoice.aspx new file mode 100644 index 000000000..410567bd2 --- /dev/null +++ b/MixERP.Net.FrontEnd/Purchase/Confirmation/DirectPurchaseInvoice.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="DirectPurchaseInvoice.aspx.cs" Inherits="MixERP.Net.FrontEnd.Purchase.Confirmation.DirectPurchaseInvoice" %> + + + + + + + + +
+ + + + diff --git a/MixERP.Net.FrontEnd/Purchase/Confirmation/DirectPurchaseInvoice.aspx.cs b/MixERP.Net.FrontEnd/Purchase/Confirmation/DirectPurchaseInvoice.aspx.cs new file mode 100644 index 000000000..230d958b3 --- /dev/null +++ b/MixERP.Net.FrontEnd/Purchase/Confirmation/DirectPurchaseInvoice.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.Purchase.Confirmation +{ + public partial class DirectPurchaseInvoice : 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); + + DirectPurchaseInvoiceReport.ParameterCollection = parameters; + } + } +} \ No newline at end of file diff --git a/MixERP.Net.FrontEnd/Purchase/Confirmation/DirectPurchaseInvoice.aspx.designer.cs b/MixERP.Net.FrontEnd/Purchase/Confirmation/DirectPurchaseInvoice.aspx.designer.cs new file mode 100644 index 000000000..bd85e9347 --- /dev/null +++ b/MixERP.Net.FrontEnd/Purchase/Confirmation/DirectPurchaseInvoice.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.Purchase.Confirmation { + + + public partial class DirectPurchaseInvoice { + + protected System.Web.UI.HtmlControls.HtmlForm form1; + + protected MixERP.Net.FrontEnd.UserControls.ReportControl DirectPurchaseInvoiceReport; + } +} diff --git a/MixERP.Net.FrontEnd/Purchase/DirectPurchase.aspx b/MixERP.Net.FrontEnd/Purchase/DirectPurchase.aspx new file mode 100644 index 000000000..7d41e8869 --- /dev/null +++ b/MixERP.Net.FrontEnd/Purchase/DirectPurchase.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="DirectPurchase.aspx.cs" Inherits="MixERP.Net.FrontEnd.Purchase.DirectPurchase" %> + + + + + + + + + + diff --git a/MixERP.Net.FrontEnd/Purchase/DirectPurchase.aspx.cs b/MixERP.Net.FrontEnd/Purchase/DirectPurchase.aspx.cs new file mode 100644 index 000000000..fa3b5050a --- /dev/null +++ b/MixERP.Net.FrontEnd/Purchase/DirectPurchase.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.Purchase +{ + public partial class DirectPurchase : MixERP.Net.BusinessLayer.BasePageClass + { + protected void Page_Load(object sender, EventArgs e) + { + + } + + protected void Purchase_SaveButtonClick(object sender, EventArgs e) + { + DateTime valueDate = MixERP.Net.Common.Conversion.TryCastDate(DirectPurchaseControl.GetForm.DateTextBox.Text); + int storeId = MixERP.Net.Common.Conversion.TryCastInteger(DirectPurchaseControl.GetForm.StoreDropDownList.SelectedItem.Value); + bool isCredit = DirectPurchaseControl.GetForm.TransactionTypeRadioButtonList.SelectedItem.Value.Equals(Resources.Titles.Credit); ; + string partyCode = DirectPurchaseControl.GetForm.PartyDropDownList.SelectedItem.Value; + GridView grid = DirectPurchaseControl.GetForm.Grid; + int cashRepositoryId = MixERP.Net.Common.Conversion.TryCastInteger(DirectPurchaseControl.GetForm.CashRepositoryDropDownList.SelectedItem.Value); + + int costCenterId = MixERP.Net.Common.Conversion.TryCastInteger(DirectPurchaseControl.GetForm.CostCenterDropDownList.SelectedItem.Value); + string referenceNumber = DirectPurchaseControl.GetForm.ReferenceNumberTextBox.Text; + string statementReference = DirectPurchaseControl.GetForm.StatementReferenceTextBox.Text; + + long transactionMasterId = MixERP.Net.BusinessLayer.Transactions.DirectPurchase.Add(valueDate, storeId, isCredit, partyCode, grid, cashRepositoryId, costCenterId, referenceNumber, statementReference); + if(transactionMasterId > 0) + { + Response.Redirect("~/Purchase/Confirmation/DirectPurchase.aspx?TranId=" + transactionMasterId, true); + } + } + + } +} \ No newline at end of file diff --git a/MixERP.Net.FrontEnd/Purchase/DirectPurchase.aspx.designer.cs b/MixERP.Net.FrontEnd/Purchase/DirectPurchase.aspx.designer.cs new file mode 100644 index 000000000..7acce7ec4 --- /dev/null +++ b/MixERP.Net.FrontEnd/Purchase/DirectPurchase.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 DirectPurchase { + + /// + /// DirectPurchaseControl control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::MixERP.Net.FrontEnd.UserControls.Products.ProductControl DirectPurchaseControl; + } +} diff --git a/MixERP.Net.FrontEnd/Purchase/GRN.aspx b/MixERP.Net.FrontEnd/Purchase/GRN.aspx new file mode 100644 index 000000000..3a50dfd9b --- /dev/null +++ b/MixERP.Net.FrontEnd/Purchase/GRN.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="GRN.aspx.cs" Inherits="MixERP.Net.FrontEnd.Purchase.GRN" %> + + + + + + + + + diff --git a/MixERP.Net.FrontEnd/Purchase/GRN.aspx.cs b/MixERP.Net.FrontEnd/Purchase/GRN.aspx.cs new file mode 100644 index 000000000..5d240bbe0 --- /dev/null +++ b/MixERP.Net.FrontEnd/Purchase/GRN.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 GRN : 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/GRN.aspx.designer.cs b/MixERP.Net.FrontEnd/Purchase/GRN.aspx.designer.cs new file mode 100644 index 000000000..34ad2b8cd --- /dev/null +++ b/MixERP.Net.FrontEnd/Purchase/GRN.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 GRN { + + /// + /// GoodReceiptNote control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::MixERP.Net.FrontEnd.UserControls.Products.ProductControl GoodReceiptNote; + } +} diff --git a/MixERP.Net.FrontEnd/Purchase/Index.aspx b/MixERP.Net.FrontEnd/Purchase/Index.aspx new file mode 100644 index 000000000..247b9fb52 --- /dev/null +++ b/MixERP.Net.FrontEnd/Purchase/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.Purchase.Index" %> + + + + + +

+ Purchases +

+
+ +
+ + 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 @@ +

+ +

+

+{Session.Street}, {Session.City}, {Session.State}, {Session.Country}. {Resources.Titles.Tel} : {Session.Phone}. {Resources.Titles.Fax} : {Session.Fax}. +
+{Resources.Titles.Email} : {Session.Email} +{Resources.Titles.Url} : +{Session.Url} +

+ +{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} +

+ {ReportHeading} +

+
+ Printed On: {PrintDate}
+ User: {UserName}
+ Office Code: {OfficeCode} +
+
+ {Table} + + + + + 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" %> + + + + + + + + + +
+ + + + Close This Form + + + + + + \ 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.

+ +
+ + +
+

+ Go Back to the Previous Page +

+ +
+ + \ 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 +[![Build Status](https://secure.travis-ci.org/marijnh/CodeMirror.png?branch=master)](http://travis-ci.org/marijnh/CodeMirror) +[![NPM version](https://badge.fury.io/js/codemirror.png)](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" : "") + "", + {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(""); + } 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;cthis.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 + + + + + + + + + +

CodeMirror: Active Line Demo

+ +
+ + + +

Styling the current cursor line.

+ + + diff --git a/MixERP.Net.FrontEnd/Scripts/CodeMirror/demo/bidi.html b/MixERP.Net.FrontEnd/Scripts/CodeMirror/demo/bidi.html new file mode 100644 index 000000000..47feb8c5a --- /dev/null +++ b/MixERP.Net.FrontEnd/Scripts/CodeMirror/demo/bidi.html @@ -0,0 +1,61 @@ + + + + + CodeMirror: Bi-directional Text Demo + + + + + + + + +

CodeMirror: Bi-directional Text Demo

+ +
+ + + +

Demonstration of bi-directional text support. See + the related + blog post for more background.

+ + + diff --git a/MixERP.Net.FrontEnd/Scripts/CodeMirror/demo/btree.html b/MixERP.Net.FrontEnd/Scripts/CodeMirror/demo/btree.html new file mode 100644 index 000000000..5e5ce0abf --- /dev/null +++ b/MixERP.Net.FrontEnd/Scripts/CodeMirror/demo/btree.html @@ -0,0 +1,87 @@ + + + + + CodeMirror: B-Tree visualization + + + + + + + +

CodeMirror: B-Tree visualization

+ +

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.

+ +
+
+
+
+
+
+ + + +

+ + + diff --git a/MixERP.Net.FrontEnd/Scripts/CodeMirror/demo/buffers.html b/MixERP.Net.FrontEnd/Scripts/CodeMirror/demo/buffers.html new file mode 100644 index 000000000..bfd8248e4 --- /dev/null +++ b/MixERP.Net.FrontEnd/Scripts/CodeMirror/demo/buffers.html @@ -0,0 +1,98 @@ + + + + + CodeMirror: Multiple Buffer & Split View Demo + + + + + + + + + +

CodeMirror: Multiple Buffer & Split View Demo

+ +
+
+ Select buffer: +     +
+
+
+ Select buffer: +     +
+ + + +

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.

+ + + diff --git a/MixERP.Net.FrontEnd/Scripts/CodeMirror/demo/changemode.html b/MixERP.Net.FrontEnd/Scripts/CodeMirror/demo/changemode.html new file mode 100644 index 000000000..364c5cdb0 --- /dev/null +++ b/MixERP.Net.FrontEnd/Scripts/CodeMirror/demo/changemode.html @@ -0,0 +1,50 @@ + + + + + CodeMirror: Mode-Changing Demo + + + + + + + + + +

CodeMirror: Mode-Changing demo

+ +
+ +

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.

+ + + + diff --git a/MixERP.Net.FrontEnd/Scripts/CodeMirror/demo/closebrackets.html b/MixERP.Net.FrontEnd/Scripts/CodeMirror/demo/closebrackets.html new file mode 100644 index 000000000..47304ea88 --- /dev/null +++ b/MixERP.Net.FrontEnd/Scripts/CodeMirror/demo/closebrackets.html @@ -0,0 +1,63 @@ + + + + + CodeMirror: Closebrackets Demo + + + + + + + + + +

CodeMirror: Closebrackets Demo

+ +

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.

+ + +
+ + + + diff --git a/MixERP.Net.FrontEnd/Scripts/CodeMirror/demo/closetag.html b/MixERP.Net.FrontEnd/Scripts/CodeMirror/demo/closetag.html new file mode 100644 index 000000000..87f4f019f --- /dev/null +++ b/MixERP.Net.FrontEnd/Scripts/CodeMirror/demo/closetag.html @@ -0,0 +1,37 @@ + + + + + CodeMirror: Close-Tag Demo + + + + + + + + + + + + +

Close-Tag Demo

+
    +
  • Type an html tag. When you type '>' or '/', the tag will auto-close/complete. Block-level tags will indent.
  • +
  • There are options for disabling tag closing or customizing the list of tags to indent.
  • +
  • Works with "text/html" (based on htmlmixed.js or xml.js) mode.
  • +
  • View source for key binding details.
  • +
+ +
+ + + + diff --git a/MixERP.Net.FrontEnd/Scripts/CodeMirror/demo/complete.html b/MixERP.Net.FrontEnd/Scripts/CodeMirror/demo/complete.html new file mode 100644 index 000000000..02ce65888 --- /dev/null +++ b/MixERP.Net.FrontEnd/Scripts/CodeMirror/demo/complete.html @@ -0,0 +1,70 @@ + + + + + CodeMirror: Autocomplete Demo + + + + + + + + + +

CodeMirror: Autocomplete demo

+ +
+ +

Press ctrl-space to activate autocompletion. See +the code (here +and here) to figure out +how it works.

+ + + + diff --git a/MixERP.Net.FrontEnd/Scripts/CodeMirror/demo/emacs.html b/MixERP.Net.FrontEnd/Scripts/CodeMirror/demo/emacs.html new file mode 100644 index 000000000..0a8cfc5d9 --- /dev/null +++ b/MixERP.Net.FrontEnd/Scripts/CodeMirror/demo/emacs.html @@ -0,0 +1,66 @@ + + + + + CodeMirror: Emacs bindings demo + + + + + + + + + + + + + + + +

CodeMirror: Emacs bindings demo

+ +
+ +

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.

+ + + + + diff --git a/MixERP.Net.FrontEnd/Scripts/CodeMirror/demo/folding.html b/MixERP.Net.FrontEnd/Scripts/CodeMirror/demo/folding.html new file mode 100644 index 000000000..ffda97c1c --- /dev/null +++ b/MixERP.Net.FrontEnd/Scripts/CodeMirror/demo/folding.html @@ -0,0 +1,69 @@ + + + + + CodeMirror: Code Folding Demo + + + + + + + + + + + + +

CodeMirror: Code Folding Demo

+ +

Demonstration of code folding using the code + in foldcode.js. + Press ctrl-q or click on the gutter to fold a block, again + to unfold.

+
+
JavaScript:
+
HTML:
+
+ + + diff --git a/MixERP.Net.FrontEnd/Scripts/CodeMirror/demo/fullscreen.html b/MixERP.Net.FrontEnd/Scripts/CodeMirror/demo/fullscreen.html new file mode 100644 index 000000000..2709ebb4b --- /dev/null +++ b/MixERP.Net.FrontEnd/Scripts/CodeMirror/demo/fullscreen.html @@ -0,0 +1,147 @@ + + + + + CodeMirror: Full Screen Editing + + + + + + + + + +

CodeMirror: Full Screen Editing

+ +
+ + +

Press F11 when cursor is in the editor to toggle full screen editing. Esc can also be used to exit full screen editing.

+ + diff --git a/MixERP.Net.FrontEnd/Scripts/CodeMirror/demo/html5complete.html b/MixERP.Net.FrontEnd/Scripts/CodeMirror/demo/html5complete.html new file mode 100644 index 000000000..5b2dd0de1 --- /dev/null +++ b/MixERP.Net.FrontEnd/Scripts/CodeMirror/demo/html5complete.html @@ -0,0 +1,44 @@ + + + + + CodeMirror: HTML completion demo + + + + + + + + + + + + + + + + +

HTML completion demo

+

Shows the XML completer + parameterized with information about the tags in HTML. + Press ctrl-space to activate completion.

+ +
+ + + + diff --git a/MixERP.Net.FrontEnd/Scripts/CodeMirror/demo/indentwrap.html b/MixERP.Net.FrontEnd/Scripts/CodeMirror/demo/indentwrap.html new file mode 100644 index 000000000..c367c945d --- /dev/null +++ b/MixERP.Net.FrontEnd/Scripts/CodeMirror/demo/indentwrap.html @@ -0,0 +1,49 @@ + + + + + CodeMirror: Indented wrapped line demo + + + + + + + + +

CodeMirror: Indented wrapped line demo

+ +
+ +

This page uses a hack on top of the "renderLine" + event to make wrapped text line up with the base indentation of + the line.

+ + + + + diff --git a/MixERP.Net.FrontEnd/Scripts/CodeMirror/demo/lint.html b/MixERP.Net.FrontEnd/Scripts/CodeMirror/demo/lint.html new file mode 100644 index 000000000..ece8b1cef --- /dev/null +++ b/MixERP.Net.FrontEnd/Scripts/CodeMirror/demo/lint.html @@ -0,0 +1,90 @@ + + + + + CodeMirror: Linter Demo + + + + + + + + + + + + + + +

CodeMirror: Linter Demo

+ +

+ +

+ + + + + diff --git a/MixERP.Net.FrontEnd/Scripts/CodeMirror/demo/loadmode.html b/MixERP.Net.FrontEnd/Scripts/CodeMirror/demo/loadmode.html new file mode 100644 index 000000000..1bd958f70 --- /dev/null +++ b/MixERP.Net.FrontEnd/Scripts/CodeMirror/demo/loadmode.html @@ -0,0 +1,40 @@ + + + + + CodeMirror: Lazy Mode Loading Demo + + + + + + + + +

CodeMirror: Lazy Mode Loading

+ +
+

+ + + + diff --git a/MixERP.Net.FrontEnd/Scripts/CodeMirror/demo/marker.html b/MixERP.Net.FrontEnd/Scripts/CodeMirror/demo/marker.html new file mode 100644 index 000000000..f0981e4d5 --- /dev/null +++ b/MixERP.Net.FrontEnd/Scripts/CodeMirror/demo/marker.html @@ -0,0 +1,59 @@ + + + + + CodeMirror: Breakpoint Demo + + + + + + + + +

CodeMirror: Breakpoint demo

+ +
+ +

Click the line-number gutter to add or remove 'breakpoints'.

+ + + + + diff --git a/MixERP.Net.FrontEnd/Scripts/CodeMirror/demo/markselection.html b/MixERP.Net.FrontEnd/Scripts/CodeMirror/demo/markselection.html new file mode 100644 index 000000000..e1c054869 --- /dev/null +++ b/MixERP.Net.FrontEnd/Scripts/CodeMirror/demo/markselection.html @@ -0,0 +1,36 @@ + + + + + CodeMirror: Match Highlighter Demo + + + + + + + + + +

CodeMirror: Mark Selection Demo

+ +
+ + + +

Simple addon to easily mark (and style) selected text.

+ + + diff --git a/MixERP.Net.FrontEnd/Scripts/CodeMirror/demo/matchhighlighter.html b/MixERP.Net.FrontEnd/Scripts/CodeMirror/demo/matchhighlighter.html new file mode 100644 index 000000000..c574fbae8 --- /dev/null +++ b/MixERP.Net.FrontEnd/Scripts/CodeMirror/demo/matchhighlighter.html @@ -0,0 +1,38 @@ + + + + + CodeMirror: Match Highlighter Demo + + + + + + + + + +

CodeMirror: Match Highlighter Demo

+ +
+ + + +

Search and highlight occurences of the selected text.

+ + + diff --git a/MixERP.Net.FrontEnd/Scripts/CodeMirror/demo/merge.html b/MixERP.Net.FrontEnd/Scripts/CodeMirror/demo/merge.html new file mode 100644 index 000000000..907f769d5 --- /dev/null +++ b/MixERP.Net.FrontEnd/Scripts/CodeMirror/demo/merge.html @@ -0,0 +1,63 @@ + + + + + + + + + + + CodeMirror: merge view demo + + + +

CodeMirror: merge view demo

+ +
+ +

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.

+ +

This addon depends on +the google-diff-match-patch +library to compute the diffs.

+ + diff --git a/MixERP.Net.FrontEnd/Scripts/CodeMirror/demo/multiplex.html b/MixERP.Net.FrontEnd/Scripts/CodeMirror/demo/multiplex.html new file mode 100644 index 000000000..ec0519cb9 --- /dev/null +++ b/MixERP.Net.FrontEnd/Scripts/CodeMirror/demo/multiplex.html @@ -0,0 +1,66 @@ + + + + + CodeMirror: Multiplexing Parser Demo + + + + + + + + + +

CodeMirror: Multiplexing Parser Demo

+ +
+ + + +

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.

+ +

+ Parsing/Highlighting Tests: + normal, + verbose. +

+ + + diff --git a/MixERP.Net.FrontEnd/Scripts/CodeMirror/demo/mustache.html b/MixERP.Net.FrontEnd/Scripts/CodeMirror/demo/mustache.html new file mode 100644 index 000000000..9d2081dc4 --- /dev/null +++ b/MixERP.Net.FrontEnd/Scripts/CodeMirror/demo/mustache.html @@ -0,0 +1,59 @@ + + + + + CodeMirror: Overlay Parser Demo + + + + + + + + + +

CodeMirror: Overlay Parser Demo

+ +
+ + + +

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.

+ + + diff --git a/MixERP.Net.FrontEnd/Scripts/CodeMirror/demo/placeholder.html b/MixERP.Net.FrontEnd/Scripts/CodeMirror/demo/placeholder.html new file mode 100644 index 000000000..b0f245695 --- /dev/null +++ b/MixERP.Net.FrontEnd/Scripts/CodeMirror/demo/placeholder.html @@ -0,0 +1,36 @@ + + + + + CodeMirror: Placeholder demo + + + + + + + + +

CodeMirror: Placeholder demo

+ +
+ +

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.

+ + + + + diff --git a/MixERP.Net.FrontEnd/Scripts/CodeMirror/demo/preview.html b/MixERP.Net.FrontEnd/Scripts/CodeMirror/demo/preview.html new file mode 100644 index 000000000..f70cdb009 --- /dev/null +++ b/MixERP.Net.FrontEnd/Scripts/CodeMirror/demo/preview.html @@ -0,0 +1,76 @@ + + + + + CodeMirror: HTML5 preview + + + + + + + + + + +

CodeMirror: HTML5 preview

+ + + + + diff --git a/MixERP.Net.FrontEnd/Scripts/CodeMirror/demo/resize.html b/MixERP.Net.FrontEnd/Scripts/CodeMirror/demo/resize.html new file mode 100644 index 000000000..7badc2bfb --- /dev/null +++ b/MixERP.Net.FrontEnd/Scripts/CodeMirror/demo/resize.html @@ -0,0 +1,49 @@ + + + + + CodeMirror: Autoresize Demo + + + + + + + + +

CodeMirror: Autoresize demo

+ +
+ +

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.

+ + + + + diff --git a/MixERP.Net.FrontEnd/Scripts/CodeMirror/demo/runmode.html b/MixERP.Net.FrontEnd/Scripts/CodeMirror/demo/runmode.html new file mode 100644 index 000000000..dba808ba7 --- /dev/null +++ b/MixERP.Net.FrontEnd/Scripts/CodeMirror/demo/runmode.html @@ -0,0 +1,50 @@ + + + + + CodeMirror: Mode Runner Demo + + + + + + + +

CodeMirror: Mode Runner Demo

+ +
+ +

+
+    
+
+    

Running a CodeMirror mode outside of the editor. + The CodeMirror.runMode function, defined + in lib/runmode.js takes the following arguments:

+ +
+
text (string)
+
The document to run through the highlighter.
+
mode (mode spec)
+
The mode to use (must be loaded as normal).
+
output (function or DOM node)
+
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/search.html b/MixERP.Net.FrontEnd/Scripts/CodeMirror/demo/search.html new file mode 100644 index 000000000..d72107156 --- /dev/null +++ b/MixERP.Net.FrontEnd/Scripts/CodeMirror/demo/search.html @@ -0,0 +1,85 @@ + + + + + CodeMirror: Search/Replace Demo + + + + + + + + + + + + +

CodeMirror: Search/Replace Demo

+ +
+ + + +

Demonstration of primitive search/replace functionality. The + keybindings (which can be overridden by custom keymaps) are:

+
+
Ctrl-F / Cmd-F
Start searching
+
Ctrl-G / Cmd-G
Find next
+
Shift-Ctrl-G / Shift-Cmd-G
Find previous
+
Shift-Ctrl-F / Cmd-Option-F
Replace
+
Shift-Ctrl-R / Shift-Cmd-Option-F
Replace all
+
+

Searching is enabled by + including addon/search/search.js + and addon/search/searchcursor.js. + For good-looking input dialogs, you also want to include + addon/dialog/dialog.js + and addon/dialog/dialog.css.

+ + 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.

+ +
+

+
+    
+  
+
diff --git a/MixERP.Net.FrontEnd/Scripts/CodeMirror/demo/theme.html b/MixERP.Net.FrontEnd/Scripts/CodeMirror/demo/theme.html
new file mode 100644
index 000000000..147a89ff1
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Scripts/CodeMirror/demo/theme.html
@@ -0,0 +1,90 @@
+
+
+  
+    
+    CodeMirror: Theme Demo
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+
+    
+  
+  
+    

CodeMirror: Theme demo

+ +
+ +

Select a theme: +

+ + + + diff --git a/MixERP.Net.FrontEnd/Scripts/CodeMirror/demo/trailingspace.html b/MixERP.Net.FrontEnd/Scripts/CodeMirror/demo/trailingspace.html new file mode 100644 index 000000000..ca74152ec --- /dev/null +++ b/MixERP.Net.FrontEnd/Scripts/CodeMirror/demo/trailingspace.html @@ -0,0 +1,39 @@ + + + + + CodeMirror: Trailing Whitespace Demo + + + + + + + + +

CodeMirror: Trailing Whitespace Demo

+ +
+ + + +

Uses +the trailingspace +addon to highlight trailing whitespace.

+ + + diff --git a/MixERP.Net.FrontEnd/Scripts/CodeMirror/demo/variableheight.html b/MixERP.Net.FrontEnd/Scripts/CodeMirror/demo/variableheight.html new file mode 100644 index 000000000..b00f7e454 --- /dev/null +++ b/MixERP.Net.FrontEnd/Scripts/CodeMirror/demo/variableheight.html @@ -0,0 +1,52 @@ + + + + + CodeMirror: Variable Height Demo + + + + + + + + + +

CodeMirror: Variable Height Demo

+ +
+ + + diff --git a/MixERP.Net.FrontEnd/Scripts/CodeMirror/demo/vim.html b/MixERP.Net.FrontEnd/Scripts/CodeMirror/demo/vim.html new file mode 100644 index 000000000..c5835d40d --- /dev/null +++ b/MixERP.Net.FrontEnd/Scripts/CodeMirror/demo/vim.html @@ -0,0 +1,65 @@ + + + + + CodeMirror: Vim bindings demo + + + + + + + + + + + + +

CodeMirror: Vim bindings demo

+ +
+ +
+ +

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.

+ + + + + diff --git a/MixERP.Net.FrontEnd/Scripts/CodeMirror/demo/visibletabs.html b/MixERP.Net.FrontEnd/Scripts/CodeMirror/demo/visibletabs.html new file mode 100644 index 000000000..109d1a6b0 --- /dev/null +++ b/MixERP.Net.FrontEnd/Scripts/CodeMirror/demo/visibletabs.html @@ -0,0 +1,53 @@ + + + + + CodeMirror: Visible tabs demo + + + + + + + + +

CodeMirror: Visible tabs demo

+ +
+ +

Tabs inside the editor are spans with the +class cm-tab, and can be styled.

+ + + + + diff --git a/MixERP.Net.FrontEnd/Scripts/CodeMirror/demo/widget.html b/MixERP.Net.FrontEnd/Scripts/CodeMirror/demo/widget.html new file mode 100644 index 000000000..a3b27a9e4 --- /dev/null +++ b/MixERP.Net.FrontEnd/Scripts/CodeMirror/demo/widget.html @@ -0,0 +1,74 @@ + + + + + CodeMirror: Inline Widget Demo + + + + + + + + + +

CodeMirror: Inline Widget Demo

+ +
+ +

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.

+ + diff --git a/MixERP.Net.FrontEnd/Scripts/CodeMirror/demo/xmlcomplete.html b/MixERP.Net.FrontEnd/Scripts/CodeMirror/demo/xmlcomplete.html new file mode 100644 index 000000000..fdf335b2e --- /dev/null +++ b/MixERP.Net.FrontEnd/Scripts/CodeMirror/demo/xmlcomplete.html @@ -0,0 +1,106 @@ + + + + + CodeMirror: XML Autocomplete Demo + + + + + + + + + + +

CodeMirror: XML Autocomplete demo

+ +
+ +

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 @@ + + + +image/svg+xml \ 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 + + + + + +

{ } CodeMirror

+ +
+ +
+/* Script 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.

+ +
+ +

Version:

+ + + +

+ with UglifyJS +

+ +

Custom code to add to the compressed file:

+
+ + + + + diff --git a/MixERP.Net.FrontEnd/Scripts/CodeMirror/doc/docs.css b/MixERP.Net.FrontEnd/Scripts/CodeMirror/doc/docs.css new file mode 100644 index 000000000..170cd4124 --- /dev/null +++ b/MixERP.Net.FrontEnd/Scripts/CodeMirror/doc/docs.css @@ -0,0 +1,167 @@ +body { + font-family: Droid Sans, Arial, sans-serif; + line-height: 1.5; + max-width: 64.3em; + margin: 3em auto; + padding: 0 1em; +} + +h1 { + letter-spacing: -3px; + font-size: 3.23em; + font-weight: bold; + margin: 0; +} + +h2 { + font-size: 1.23em; + font-weight: bold; + margin: .5em 0; + letter-spacing: -1px; +} + +h3 { + font-size: 1.1em; + font-weight: bold; + margin: .4em 0; +} + +pre { + background-color: #eee; + -moz-border-radius: 6px; + -webkit-border-radius: 6px; + border-radius: 6px; + padding: 1em; +} + +pre.code { + margin: 0 1em; +} + +.grey { + background-color: #eee; + border-radius: 6px; + margin-bottom: 1.65em; + margin-top: 0.825em; + padding: 0.825em 1.65em; + position: relative; +} + +img.logo { + position: absolute; + right: -1em; + bottom: 4px; + max-width: 23.6875em; /* Scale image down with text to prevent clipping */ +} + +.grey > pre { + background:none; + border-radius:0; + padding:0; + margin:0; + font-size:2.2em; + line-height:1.2em; +} + +a:link, a:visited, .quasilink { + color: #df0019; + cursor: pointer; + text-decoration: none; +} + +a:hover, .quasilink:hover { + color: #800004; +} + +h1 a:link, h1 a:visited, h1 a:hover { + color: black; +} + +ul { + margin: 0; + padding-left: 1.2em; +} + +a.download { + color: white; + background-color: #df0019; + width: 100%; + display: block; + text-align: center; + font-size: 1.23em; + font-weight: bold; + text-decoration: none; + -moz-border-radius: 6px; + -webkit-border-radius: 6px; + border-radius: 6px; + padding: .5em 0; + margin-bottom: 1em; +} + +a.download:hover { + background-color: #bb0010; +} + +.rel { + margin-bottom: 0; +} + +.rel-note { + color: #777; + font-size: .9em; + margin-top: .1em; +} + +.logo-braces { + color: #df0019; + position: relative; + top: -4px; +} + +.blk { + float: left; +} + +.left { + margin-right: 20.68em; + max-width: 37em; + padding-right: 6.53em; + padding-bottom: 1em; +} + +.left1 { + width: 15.24em; + padding-right: 6.45em; +} + +.left2 { + max-width: 15.24em; +} + +.right { + width: 20.68em; + margin-left: -20.68em; +} + +.leftbig { + width: 42.44em; + padding-right: 6.53em; +} + +.rightsmall { + width: 15.24em; +} + +.clear:after { + visibility: hidden; + display: block; + font-size: 0; + content: " "; + clear: both; + height: 0; +} +.clear { display: inline-block; } +/* start commented backslash hack \*/ +* html .clear { height: 1%; } +.clear { display: block; } +/* close commented backslash hack */ diff --git a/MixERP.Net.FrontEnd/Scripts/CodeMirror/doc/internals.html b/MixERP.Net.FrontEnd/Scripts/CodeMirror/doc/internals.html new file mode 100644 index 000000000..4336ba4d1 --- /dev/null +++ b/MixERP.Net.FrontEnd/Scripts/CodeMirror/doc/internals.html @@ -0,0 +1,505 @@ + + + + + CodeMirror: Internals + + + + + + +

{ } CodeMirror

+ +
+ +
+/* (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.

+ +
+ +
 
+ + diff --git a/MixERP.Net.FrontEnd/Scripts/CodeMirror/doc/manual.html b/MixERP.Net.FrontEnd/Scripts/CodeMirror/doc/manual.html new file mode 100644 index 000000000..655e64db4 --- /dev/null +++ b/MixERP.Net.FrontEnd/Scripts/CodeMirror/doc/manual.html @@ -0,0 +1,2253 @@ + + + + + CodeMirror: User Manual + + + + + + + + + + + + + + + +

{ } CodeMirror

+ +
+ +
+/* User manual and
+   reference guide */
+
+
+ +
+ +

Overview

+ +

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:

+ +
<script src="lib/codemirror.js"></script>
+<link rel="stylesheet" href="../lib/codemirror.css">
+<script src="mode/javascript/javascript.js"></script>
+ +

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:

+ +
var myCodeMirror = CodeMirror(document.body, {
+  value: "function myScript(){return 100;}\n",
+  mode:  "javascript"
+});
+ +

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:

+ +
var myCodeMirror = CodeMirror(function(elt) {
+  myTextArea.parentNode.replaceChild(elt, myTextArea);
+}, {value: myTextArea.value});
+ +

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.
+ +
lineNumberFormatter: function(line: integer) → string
+
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.
+ +
onDragEvent: function(instance: CodeMirror, event: Event) → boolean
+
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.
+ +
onKeyEvent: function(instance: CodeMirror, event: Event) → boolean
+
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.
+ +
workDelay: number
+
See workTime.
+ +
pollInterval: number
+
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.

+ +
+
"change" (instance: CodeMirror, changeObj: object)
+
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).
+ +
"beforeChange" (instance: CodeMirror, changeObj: object)
+
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.
+ +
"keyHandled" (instance: CodeMirror, name: string, event: Event)
+
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.
+ +
"inputRead" (instance: CodeMirror, changeObj: object)
+
Fired whenever new input is read from the hidden textarea + (typed or pasted by the user).
+ +
"beforeSelectionChange" (instance: CodeMirror, selection: {head, anchor})
+
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.
+ +
"gutterClick" (instance: CodeMirror, line: integer, gutter: string, clickEvent: Event)
+
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.
+ +
"renderLine" (instance: CodeMirror, line: LineHandle, element: Element)
+
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.
+ +
"mousedown", + "dblclick", "keydown", "keypress", + "keyup", "dragstart", "dragenter", + "dragover", "drop" + (instance: CodeMirror, event: Event)
+
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).
+ +
"beforeChange" (doc: CodeMirror.Doc, change: object)
+
See the description of the + same event on editor instances.
+ +
"cursorActivity" (doc: CodeMirror.Doc)
+
Fired whenever the cursor or selection in this document + changes.
+ +
"beforeSelectionChange" (doc: CodeMirror.Doc, selection: {head, anchor})
+
Equivalent to + the event by the same + name as fired on editor instances.
+
+ +

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.

+ +
+{
+  Tab: function(cm) {
+    var spaces = Array(cm.getOption("indentUnit") + 1).join(" ");
+    cm.replaceSelection(spaces, "end", "+input");
+  }
+}
+ +

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.
+ +
CodeMirror-matchingbracket, + CodeMirror-nonmatchingbracket
+
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.

+ +

See CodeMirror.fromTextArea + for another way to construct an editor instance.

+ +

Content manipulation methods

+ +
+
doc.getValue(?separator: string) → string
+
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).
+
doc.eachLine(f: (line: LineHandle))
+
doc.eachLine(start: integer, end: integer, f: (line: LineHandle))
+
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.
+
+ +

Cursor and selection methods

+ +
+
doc.getSelection() → string
+
Get the currently selected code.
+
doc.replaceSelection(replacement: string, ?collapse: string)
+
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.
+
doc.setSelection(anchor: {line, ch}, head: {line, ch})
+
Set the selection range. anchor + and head should be {line, ch} + objects. head defaults to anchor when + not given.
+
doc.extendSelection(from: {line, ch}, ?to: {line, ch})
+
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.
+ +
cm.hasFocus() → boolean
+
Tells you whether the editor currently has focus.
+ +
cm.findPosH(start: {line, ch}, amount: integer, unit: string, visually: boolean) → {line, ch, ?hitSide: boolean}
+
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.
+
cm.findPosV(start: {line, ch}, amount: integer, unit: string) → {line, ch, ?hitSide: boolean}
+
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.
+ +
cm.addOverlay(mode: string|object, ?options: object)
+
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.
+
doc.iterLinkedDocs(function: (doc: CodeMirror.Doc, sharedHist: boolean))
+
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.
+
+ +

History-related methods

+ +
+
doc.undo()
+
Undo one edit (if any undo events are stored).
+
doc.redo()
+
Redo one undone edit.
+ +
doc.historySize() → {undo: integer, redo: integer}
+
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.
+ +
doc.setBookmark(pos: {line, ch}, ?options: object) → TextMarker
+
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.
+
+ +
doc.findMarksAt(pos: {line, ch}) → array<TextMarker>
+
Returns an array of all the bookmarks and marked ranges + present at the given position.
+
doc.getAllMarks() → array<TextMarker>
+
Returns an array containing all marked ranges in the document.
+
+ +

Widget, gutter, and decoration methods

+ +
+
cm.setGutterMarker(line: integer|LineHandle, gutterID: string, value: Element) → LineHandle
+
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.
+ +
cm.addLineClass(line: integer|LineHandle, where: string, class: string) → LineHandle
+
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.
+ +
cm.removeLineClass(line: integer|LineHandle, where: string, class: string) → LineHandle
+
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.
+ +
cm.addWidget(pos: {line, ch}, node: Element, scrollIntoView: boolean)
+
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).
+ +
cm.addLineWidget(line: integer|LineHandle, node: Element, ?options: object) → LineWidget
+
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.
+
+
+
+ +

Sizing, scrolling and positioning methods

+ +
+
cm.setSize(width: number|string, height: number|string)
+
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.
+
cm.getScrollInfo() → {left, top, width, height, clientWidth, clientHeight}
+
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).
+
cm.scrollIntoView(pos: {line, ch}|{left, top, right, bottom}, ?margin: number)
+
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.
+ +
cm.cursorCoords(where: boolean|{line, ch}, mode: string) → {left, top, bottom}
+
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.
+
cm.charCoords(pos: {line, ch}, ?mode: string) → {left, right, top, bottom}
+
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.
+
cm.coordsChar(object: {left, top}, ?mode: string) → {line, ch}
+
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.
+ +
cm.getTokenAt(pos: {line, ch}, ?precise: boolean) → 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.
+ +
cm.getStateAfter(?line: integer, ?precise: boolean) → object
+
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.
+ +
cm.indentLine(line: integer, ?dir: string|integer)
+
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.
+
doc.indexFromPos(object: {line, ch}) → integer
+
The reverse of posFromIndex.
+ +
cm.focus()
+
Give the editor focus.
+ +
cm.getInputField() → TextAreaElement
+
Returns the hidden textarea used to read input.
+
cm.getWrapperElement() → Element
+
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.
+ +
CodeMirror.fromTextArea(textArea: TextAreaElement, ?config: object)
+
+ 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).
+ +
CodeMirror.defineExtension(name: string, value: any)
+
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.
+ +
CodeMirror.defineDocExtension(name: string, value: any)
+
Like defineExtension, + but the method will be added to the interface + for Doc objects instead.
+ +
CodeMirror.defineOption(name: string, + default: any, updateFunc: function)
+
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:

+ +
+
dialog/dialog.js
+
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.
+ +
search/searchcursor.js
+
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.
+ +
edit/matchbrackets.js
+
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.
+ +
edit/closebrackets.js
+
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.
+ +
edit/trailingspace.js
+
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.
+ +
comment/comment.js
+
Addon for commenting and uncommenting code. Adds three + methods to CodeMirror instances: +
+
lineComment(from: {line, ch}, to: {line, ch}, ?options: object)
+
Set the lines in the given range to be line comments. Will + fall back to blockComment when no line comment + style is defined for the mode.
+
blockComment(from: {line, ch}, to: {line, ch}, ?options: object)
+
Wrap the code in the given range in a block comment. Will + fall back to lineComment when no block comment + style is defined for the mode.
+
uncomment(from: {line, ch}, to: {line, ch}, ?options: object) → boolean
+
Try to uncomment the given range. + Returns true if a comment range was found and + removed, false otherwise.
+
+ The options object accepted by these methods may + have the following properties: +
+
blockCommentStart, blockCommentEnd, blockCommentLead, lineComment: string
+
Override the comment string + properties of the mode with custom comment strings.
+
padding: string
+
A string that will be inserted after opening and before + closing comment markers. Defaults to a single space.
+
commentBlankLines: boolean
+
Whether, when adding line comments, to also comment lines + that contain only whitespace.
+
indent: boolean
+
When adding line comments and this is turned on, it will + align the comment block to the current indentation of the + first line of the block.
+
fullLines: boolean
+
When block commenting, this controls whether the whole + lines are indented, or only the precise range that is given. + Defaults to true.
+
+ The addon also defines + a toggleComment command, + which will try to uncomment the current selection, and if that + fails, line-comments it.
+ +
fold/foldcode.js
+
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.
+
+ See the demo for an + example.
+ +
runmode/runmode.js
+
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/overlay.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/multiplex.js
+
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.
+ +
hint/show-hint.js
+
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.
+ +
hint/javascript-hint.js
+
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.
+ +
hint/xml-hint.js
+
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.
+ +
hint/html-hint.js
+
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.
+ +
hint/python-hint.js
+
A very simple hinting function for Python code. + Defines CodeMirror.pythonHint.
+ +
match-highlighter.js
+
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.
+ +
lint/lint.js
+
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.
+ +
selection/mark-selection.js
+
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.
+ +
selection/active-line.js
+
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.
+ +
edit/closetag.js
+
Provides utility functions for adding automatic tag closing + to XML modes. See + the demo.
+ +
mode/loadmode.js
+
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.
+ +
edit/continuecomment.js
+
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..
+ +
display/placeholder.js
+
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.
+ +
merge/merge.js
+
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.
+ +
eat(match: string|regexp|function(char: string) → boolean) → string
+
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.
+
eatWhile(match: string|regexp|function(char: string) → boolean) → boolean
+
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.
+
match(pattern: string, ?consume: boolean, ?caseFold: boolean) → boolean
+
match(pattern: regexp, ?consume: boolean) → array<string>
+
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.

+ +
+ +
 
+ + + + + diff --git a/MixERP.Net.FrontEnd/Scripts/CodeMirror/doc/modes.html b/MixERP.Net.FrontEnd/Scripts/CodeMirror/doc/modes.html new file mode 100644 index 000000000..af798aa77 --- /dev/null +++ b/MixERP.Net.FrontEnd/Scripts/CodeMirror/doc/modes.html @@ -0,0 +1,96 @@ + + + + + CodeMirror: Mode list + + + + + +

{ } CodeMirror

+ +
+ +
+/* Full list of
+   modes */
+
+
+ +

Every mode in the distribution. The list on the front-page leaves +out some of the more obscure ones.

+ + + + + diff --git a/MixERP.Net.FrontEnd/Scripts/CodeMirror/doc/oldrelease.html b/MixERP.Net.FrontEnd/Scripts/CodeMirror/doc/oldrelease.html new file mode 100644 index 000000000..40e15032b --- /dev/null +++ b/MixERP.Net.FrontEnd/Scripts/CodeMirror/doc/oldrelease.html @@ -0,0 +1,534 @@ + + + + + CodeMirror + + + + + + +

{ } CodeMirror

+ +
+ +
+/* Old release
+   history */
+
+
+ +

20-11-2012: Version 2.36:

+ + + +

20-11-2012: Version 3.0, release candidate 1:

+ + + +

22-10-2012: Version 2.35:

+ +
    +
  • New (sub) mode: TypeScript.
  • +
  • Don't overwrite (insert key) when pasting.
  • +
  • Fix several bugs in markText/undo interaction.
  • +
  • Better indentation of JavaScript code without semicolons.
  • +
  • Add defineInitHook function.
  • +
  • Full list of patches.
  • +
+ +

22-10-2012: Version 3.0, beta 2:

+ +
    +
  • Fix page-based coordinate computation.
  • +
  • Fix firing of gutterClick event.
  • +
  • Add cursorHeight option.
  • +
  • Fix bi-directional text regression.
  • +
  • Add viewportMargin option.
  • +
  • Directly handle mousewheel events (again, hopefully better).
  • +
  • Make vertical cursor movement more robust (through widgets, big line gaps).
  • +
  • Add flattenSpans option.
  • +
  • Many optimizations. Poor responsiveness should be fixed.
  • +
  • Initialization in hidden state works again.
  • +
  • Full list of patches.
  • +
+ +

19-09-2012: Version 2.34:

+ +
    +
  • New mode: Common Lisp.
  • +
  • Fix right-click select-all on most browsers.
  • +
  • Change the way highlighting happens:
      Saves memory and CPU cycles.
      compareStates is no longer needed.
      onHighlightComplete no longer works.
  • +
  • Integrate mode (Markdown, XQuery, CSS, sTex) tests in central testsuite.
  • +
  • Add a CodeMirror.version property.
  • +
  • More robust handling of nested modes in formatting and closetag plug-ins.
  • +
  • Un/redo now preserves marked text and bookmarks.
  • +
  • Full list of patches.
  • +
+ +

19-09-2012: Version 3.0, beta 1:

+ +
    +
  • Bi-directional text support.
  • +
  • More powerful gutter model.
  • +
  • Support for arbitrary text/widget height.
  • +
  • In-line widgets.
  • +
  • Generalized event handling.
  • +
+ +

23-08-2012: Version 2.33:

+ +
    +
  • New mode: Sieve.
  • +
  • New getViewPort and onViewportChange API.
  • +
  • Configurable cursor blink rate.
  • +
  • Make binding a key to false disabling handling (again).
  • +
  • Show non-printing characters as red dots.
  • +
  • More tweaks to the scrolling model.
  • +
  • Expanded testsuite. Basic linter added.
  • +
  • Remove most uses of innerHTML. Remove CodeMirror.htmlEscape.
  • +
  • Full list of patches.
  • +
+ +

23-07-2012: Version 2.32:

+ +

Emergency fix for a bug where an editor with + line wrapping on IE will break when there is no + scrollbar.

+ +

20-07-2012: Version 2.31:

+ + + +

22-06-2012: Version 2.3:

+ +
    +
  • New scrollbar implementation. Should flicker less. Changes DOM structure of the editor.
  • +
  • New theme: vibrant-ink.
  • +
  • Many extensions to the VIM keymap (including text objects).
  • +
  • Add mode-multiplexing utility script.
  • +
  • Fix bug where right-click paste works in read-only mode.
  • +
  • Add a getScrollInfo method.
  • +
  • Lots of other fixes.
  • +
+ +

23-05-2012: Version 2.25:

+ +
    +
  • New mode: Erlang.
  • +
  • Remove xmlpure mode (use xml.js).
  • +
  • Fix line-wrapping in Opera.
  • +
  • Fix X Windows middle-click paste in Chrome.
  • +
  • Fix bug that broke pasting of huge documents.
  • +
  • Fix backspace and tab key repeat in Opera.
  • +
+ +

23-04-2012: Version 2.24:

+ +
    +
  • Drop support for Internet Explorer 6.
  • +
  • New + modes: Shell, Tiki + wiki, Pig Latin.
  • +
  • New themes: Ambiance, Blackboard.
  • +
  • More control over drag/drop + with dragDrop + and onDragEvent + options.
  • +
  • Make HTML mode a bit less pedantic.
  • +
  • Add compoundChange API method.
  • +
  • Several fixes in undo history and line hiding.
  • +
  • Remove (broken) support for catchall in key maps, + add nofallthrough boolean field instead.
  • +
+ +

26-03-2012: Version 2.23:

+ +
    +
  • Change default binding for tab [more] + +
  • +
  • New modes: XQuery and VBScript.
  • +
  • Two new themes: lesser-dark and xq-dark.
  • +
  • Differentiate between background and text styles in setLineClass.
  • +
  • Fix drag-and-drop in IE9+.
  • +
  • Extend charCoords + and cursorCoords with a mode argument.
  • +
  • Add autofocus option.
  • +
  • Add findMarksAt method.
  • +
+ +

27-02-2012: Version 2.22:

+ + + +

27-01-2012: Version 2.21:

+ +
    +
  • Added LESS, MySQL, + Go, and Verilog modes.
  • +
  • Add smartIndent + option.
  • +
  • Support a cursor in readOnly-mode.
  • +
  • Support assigning multiple styles to a token.
  • +
  • Use a new approach to drawing the selection.
  • +
  • Add scrollTo method.
  • +
  • Allow undo/redo events to span non-adjacent lines.
  • +
  • Lots and lots of bugfixes.
  • +
+ +

20-12-2011: Version 2.2:

+ + + +

21-11-2011: Version 2.18:

+

Fixes TextMarker.clear, which is broken in 2.17.

+ +

21-11-2011: Version 2.17:

+
    +
  • Add support for line + wrapping and code + folding.
  • +
  • Add Github-style Markdown mode.
  • +
  • Add Monokai + and Rubyblue themes.
  • +
  • Add setBookmark method.
  • +
  • Move some of the demo code into reusable components + under lib/util.
  • +
  • Make screen-coord-finding code faster and more reliable.
  • +
  • Fix drag-and-drop in Firefox.
  • +
  • Improve support for IME.
  • +
  • Speed up content rendering.
  • +
  • Fix browser's built-in search in Webkit.
  • +
  • Make double- and triple-click work in IE.
  • +
  • Various fixes to modes.
  • +
+ +

27-10-2011: Version 2.16:

+
    +
  • Add Perl, Rust, TiddlyWiki, and Groovy modes.
  • +
  • Dragging text inside the editor now moves, rather than copies.
  • +
  • Add a coordsFromIndex method.
  • +
  • API change: setValue now no longer clears history. Use clearHistory for that.
  • +
  • API change: markText now + returns an object with clear and find + methods. Marked text is now more robust when edited.
  • +
  • Fix editing code with tabs in Internet Explorer.
  • +
+ +

26-09-2011: Version 2.15:

+

Fix bug that snuck into 2.14: Clicking the + character that currently has the cursor didn't re-focus the + editor.

+ +

26-09-2011: Version 2.14:

+ + + +

23-08-2011: Version 2.13:

+ + +

25-07-2011: Version 2.12:

+
    +
  • Add a SPARQL mode.
  • +
  • Fix bug with cursor jumping around in an unfocused editor in IE.
  • +
  • Allow key and mouse events to bubble out of the editor. Ignore widget clicks.
  • +
  • Solve cursor flakiness after undo/redo.
  • +
  • Fix block-reindent ignoring the last few lines.
  • +
  • Fix parsing of multi-line attrs in XML mode.
  • +
  • Use innerHTML for HTML-escaping.
  • +
  • Some fixes to indentation in C-like mode.
  • +
  • Shrink horiz scrollbars when long lines removed.
  • +
  • Fix width feedback loop bug that caused the width of an inner DIV to shrink.
  • +
+ +

04-07-2011: Version 2.11:

+
    +
  • Add a Scheme mode.
  • +
  • Add a replace method to search cursors, for cursor-preserving replacements.
  • +
  • Make the C-like mode mode more customizable.
  • +
  • Update XML mode to spot mismatched tags.
  • +
  • Add getStateAfter API and compareState mode API methods for finer-grained mode magic.
  • +
  • Add a getScrollerElement API method to manipulate the scrolling DIV.
  • +
  • Fix drag-and-drop for Firefox.
  • +
  • Add a C# configuration for the C-like mode.
  • +
  • Add full-screen editing and mode-changing demos.
  • +
+ +

07-06-2011: Version 2.1:

+

Add + a theme system + (demo). Note that this is not + backwards-compatible—you'll have to update your styles and + modes!

+ +

07-06-2011: Version 2.02:

+
    +
  • Add a Lua mode.
  • +
  • Fix reverse-searching for a regexp.
  • +
  • Empty lines can no longer break highlighting.
  • +
  • Rework scrolling model (the outer wrapper no longer does the scrolling).
  • +
  • Solve horizontal jittering on long lines.
  • +
  • Add runmode.js.
  • +
  • Immediately re-highlight text when typing.
  • +
  • Fix problem with 'sticking' horizontal scrollbar.
  • +
+ +

26-05-2011: Version 2.01:

+
    +
  • Add a Smalltalk mode.
  • +
  • Add a reStructuredText mode.
  • +
  • Add a Python mode.
  • +
  • Add a PL/SQL mode.
  • +
  • coordsChar now works
  • +
  • Fix a problem where onCursorActivity interfered with onChange.
  • +
  • Fix a number of scrolling and mouse-click-position glitches.
  • +
  • Pass information about the changed lines to onChange.
  • +
  • Support cmd-up/down on OS X.
  • +
  • Add triple-click line selection.
  • +
  • Don't handle shift when changing the selection through the API.
  • +
  • Support "nocursor" mode for readOnly option.
  • +
  • Add an onHighlightComplete option.
  • +
  • Fix the context menu for Firefox.
  • +
+ +

28-03-2011: Version 2.0:

+

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.

+ +

28-03-2011: Version 1.0:

+
    +
  • Fix error when debug history overflows.
  • +
  • Refine handling of C# verbatim strings.
  • +
  • Fix some issues with JavaScript indentation.
  • +
+ +

22-02-2011: Version 2.0 beta 2:

+

Somewhat more mature API, lots of bugs shaken out.

+ +

17-02-2011: Version 0.94:

+
    +
  • tabMode: "spaces" was modified slightly (now indents when something is selected).
  • +
  • Fixes a bug that would cause the selection code to break on some IE versions.
  • +
  • Disabling spell-check on WebKit browsers now works.
  • +
+ +

08-02-2011: Version 2.0 beta 1:

+

CodeMirror 2 is a complete rewrite of + CodeMirror, no longer depending on an editable frame.

+ +

19-01-2011: Version 0.93:

+
    +
  • Added a Regular Expression parser.
  • +
  • Fixes to the PHP parser.
  • +
  • Support for regular expression in search/replace.
  • +
  • Add save method to instances created with fromTextArea.
  • +
  • Add support for MS T-SQL in the SQL parser.
  • +
  • Support use of CSS classes for highlighting brackets.
  • +
  • Fix yet another hang with line-numbering in hidden editors.
  • +
+ +

17-12-2010: Version 0.92:

+
    +
  • Make CodeMirror work in XHTML documents.
  • +
  • Fix bug in handling of backslashes in Python strings.
  • +
  • The styleNumbers option is now officially + supported and documented.
  • +
  • onLineNumberClick option added.
  • +
  • More consistent names onLoad and + onCursorActivity callbacks. Old names still work, but + are deprecated.
  • +
  • Add a Freemarker mode.
  • +
+ +

11-11-2010: Version 0.91:

+
    +
  • Adds support for Java.
  • +
  • Small additions to the PHP and SQL parsers.
  • +
  • Work around various Webkit issues.
  • +
  • Fix toTextArea to update the code in the textarea.
  • +
  • Add a noScriptCaching option (hack to ease development).
  • +
  • Make sub-modes of HTML mixed mode configurable.
  • +
+ +

02-10-2010: Version 0.9:

+
    +
  • Add support for searching backwards.
  • +
  • There are now parsers for Scheme, XQuery, and OmetaJS.
  • +
  • Makes height: "dynamic" more robust.
  • +
  • Fixes bug where paste did not work on OS X.
  • +
  • Add a enterMode and electricChars options to make indentation even more customizable.
  • +
  • Add firstLineNumber option.
  • +
  • Fix bad handling of @media rules by the CSS parser.
  • +
  • Take a new, more robust approach to working around the invisible-last-line bug in WebKit.
  • +
+ +

22-07-2010: Version 0.8:

+
    +
  • Add a cursorCoords method to find the screen + coordinates of the cursor.
  • +
  • A number of fixes and support for more syntax in the PHP parser.
  • +
  • Fix indentation problem with JSON-mode JS parser in Webkit.
  • +
  • Add a minification UI.
  • +
  • Support a height: dynamic mode, where the editor's + height will adjust to the size of its content.
  • +
  • Better support for IME input mode.
  • +
  • Fix JavaScript parser getting confused when seeing a no-argument + function call.
  • +
  • Have CSS parser see the difference between selectors and other + identifiers.
  • +
  • Fix scrolling bug when pasting in a horizontally-scrolled + editor.
  • +
  • Support toTextArea method in instances created with + fromTextArea.
  • +
  • Work around new Opera cursor bug that causes the cursor to jump + when pressing backspace at the end of a line.
  • +
+ +

27-04-2010: Version + 0.67:

+

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.

+ +

01-03-2010: Version + 0.66:

+

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.

+ +

12-11-2009: Version + 0.65:

+

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.

+ +

23-10-2009: Version + 0.64:

+

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.

+ +

31-08-2009: Version +0.63:

+

Overhaul of paste-handling (less fragile), fixes for several +serious IE8 issues (cursor jumping, end-of-document bugs) and a number +of small problems.

+ +

30-05-2009: Version +0.62:

+

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).

+ + diff --git a/MixERP.Net.FrontEnd/Scripts/CodeMirror/doc/realworld.html b/MixERP.Net.FrontEnd/Scripts/CodeMirror/doc/realworld.html new file mode 100644 index 000000000..98aaff989 --- /dev/null +++ b/MixERP.Net.FrontEnd/Scripts/CodeMirror/doc/realworld.html @@ -0,0 +1,113 @@ + + + + + CodeMirror: Real-world uses + + + + + +

{ } CodeMirror

+ +
+ +
+/* Real world uses,
+   full list */
+
+
+ +

Contact me if you'd like + your project to be added to this list.

+ + + + + diff --git a/MixERP.Net.FrontEnd/Scripts/CodeMirror/doc/reporting.html b/MixERP.Net.FrontEnd/Scripts/CodeMirror/doc/reporting.html new file mode 100644 index 000000000..a61651253 --- /dev/null +++ b/MixERP.Net.FrontEnd/Scripts/CodeMirror/doc/reporting.html @@ -0,0 +1,60 @@ + + + + + CodeMirror: Reporting Bugs + + + + + + +

{ } CodeMirror

+ +
+ +
+/* Reporting bugs
+   effectively */
+
+
+ +
+ +

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:

+ +
    +
  1. 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.
  2. + +
  3. 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.
  4. + +
  5. 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.
  6. + +
  7. 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.
  8. + +
  9. 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.
  10. +
+ +
+ + + diff --git a/MixERP.Net.FrontEnd/Scripts/CodeMirror/doc/upgrade_v2.2.html b/MixERP.Net.FrontEnd/Scripts/CodeMirror/doc/upgrade_v2.2.html new file mode 100644 index 000000000..7e4d84004 --- /dev/null +++ b/MixERP.Net.FrontEnd/Scripts/CodeMirror/doc/upgrade_v2.2.html @@ -0,0 +1,98 @@ + + + + + CodeMirror: Upgrading to v2.2 + + + + + +

{ } CodeMirror

+ +
+ +
+/* Upgrading to
+   v2.2 */
+
+
+ +
+ +

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:

+ +
  extraKeys: {
+    "Ctrl-S": function(instance) { saveText(instance.getValue()); },
+    "Ctrl-/": "undo"
+  }
+ +

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.

+ +
+ + + diff --git a/MixERP.Net.FrontEnd/Scripts/CodeMirror/doc/upgrade_v3.html b/MixERP.Net.FrontEnd/Scripts/CodeMirror/doc/upgrade_v3.html new file mode 100644 index 000000000..7e8a6b61a --- /dev/null +++ b/MixERP.Net.FrontEnd/Scripts/CodeMirror/doc/upgrade_v3.html @@ -0,0 +1,227 @@ + + + + + CodeMirror: Upgrading to v3 + + + + + + + + + + + + + +

{ } CodeMirror

+ +
+ +
+/* Upgrading to
+   version 3 */
+
+
+ +
+ +

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.)

+ +
+cm.on("change", function(cm, change) {
+  console.log("something changed! (" + change.origin + ")");
+});
+
+ +

markText method arguments

+ +

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.

+ +
+var marked = cm.addLineClass(10, "background", "highlighted-line");
+setTimeout(function() {
+  cm.removeLineClass(marked, "background", "highlighted-line");
+});
+
+ +

Position properties

+ +

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.

+ +

Affected methods +are cursorCoords, charCoords, coordsChar, +and getScrollInfo.

+ +

Bracket matching no longer in core

+ +

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.
  • +
  • In-line widgets. See the demo + and the docs.
  • +
  • Defining custom options + with CodeMirror.defineOption.
  • +
+ +
+ + + + diff --git a/MixERP.Net.FrontEnd/Scripts/CodeMirror/index.html b/MixERP.Net.FrontEnd/Scripts/CodeMirror/index.html new file mode 100644 index 000000000..6a9dbcb60 --- /dev/null +++ b/MixERP.Net.FrontEnd/Scripts/CodeMirror/index.html @@ -0,0 +1,481 @@ + + + + + CodeMirror + + + + + + +

{ } CodeMirror

+ +
+ +
+/* In-browser code editing
+   made bearable */
+
+
+ +
+ +

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.

+ + + +

Getting the code

+ +

All of CodeMirror is released under a MIT-style license. To get it, you can download + the latest + release or the current development + snapshot as zip files. To create a custom minified script file, + you can use the compression API.

+ +

We use git for version control. + The main repository can be fetched in this way:

+ +
git clone http://marijnhaverbeke.nl/git/codemirror
+ +

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.

+ +

For those who want to learn more about the code, there is + a series of + posts on CodeMirror on my blog, and the + old overview of the editor + internals. + The source code + itself is, for the most part, also very readable.

+ +

Support and bug reports

+ +

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.

+ +

When none of these seem fitting, you can + simply e-mail the maintainer + directly.

+ +

Supported browsers

+ +

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.

+ +
+ +
+ + Download the latest release + +

Support CodeMirror

+ + + + + +

Reading material

+ + + +

Releases

+ +

20-06-2013: Version 3.14:

+ + + +

20-05-2013: Version 3.13:

+ + + +

19-04-2013: Version 3.12:

+ + + +

20-03-2013: Version 3.11:

+ + + +

21-02-2013: Version 3.1:

+ + + + +

25-01-2013: Version 3.02:

+ +

Single-bugfix release. Fixes a problem that + prevents CodeMirror instances from being garbage-collected after + they become unused.

+ +

21-01-2013: Version 3.01:

+ + + +

21-01-2013: Version 2.38:

+ +

Integrate some bugfixes, enhancements to the vim keymap, and new + modes + (D, Sass, APL) + from the v3 branch.

+ +

20-12-2012: Version 2.37:

+ +
    +
  • New mode: SQL (will replace plsql and mysql modes).
  • +
  • Further work on the new VIM mode.
  • +
  • Fix Cmd/Ctrl keys on recent Operas on OS X.
  • +
  • Full list of patches.
  • +
+ +

10-12-2012: Version 3.0:

+ +

New major version. Only + partially backwards-compatible. See + the upgrading guide for more + information. Changes since release candidate 2:

+ +
    +
  • Rewritten VIM mode.
  • +
  • Fix a few minor scrolling and sizing issues.
  • +
  • Work around Safari segfault when dragging.
  • +
  • Full list of patches.
  • +
+ + +

20-11-2012: Version 3.0, release candidate 2:

+ +
    +
  • New mode: HTTP.
  • +
  • Improved handling of selection anchor position.
  • +
  • Improve IE performance on longer lines.
  • +
  • Reduce gutter glitches during horiz. scrolling.
  • +
  • Add addKeyMap and removeKeyMap methods.
  • +
  • Rewrite formatting and closetag add-ons.
  • +
  • Full list of patches.
  • +
+ +

Older releases...

+ +
+ +
 
+ +
+ + +
+ + + 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.

+ +

MIME types defined: text/apl (APL code)

+ + diff --git a/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/asterisk/asterisk.js b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/asterisk/asterisk.js new file mode 100644 index 000000000..60b689d1d --- /dev/null +++ b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/asterisk/asterisk.js @@ -0,0 +1,183 @@ +/* + * ===================================================================================== + * + * Filename: mode/asterisk/asterisk.js + * + * Description: CodeMirror mode for Asterisk dialplan + * + * Created: 05/17/2012 09:20:25 PM + * Revision: none + * + * Author: Stas Kobzar (stas@modulis.ca), + * Company: Modulis.ca Inc. + * + * ===================================================================================== + */ + +CodeMirror.defineMode("asterisk", function() { + var atoms = ["exten", "same", "include","ignorepat","switch"], + dpcmd = ["#include","#exec"], + apps = [ + "addqueuemember","adsiprog","aelsub","agentlogin","agentmonitoroutgoing","agi", + "alarmreceiver","amd","answer","authenticate","background","backgrounddetect", + "bridge","busy","callcompletioncancel","callcompletionrequest","celgenuserevent", + "changemonitor","chanisavail","channelredirect","chanspy","clearhash","confbridge", + "congestion","continuewhile","controlplayback","dahdiacceptr2call","dahdibarge", + "dahdiras","dahdiscan","dahdisendcallreroutingfacility","dahdisendkeypadfacility", + "datetime","dbdel","dbdeltree","deadagi","dial","dictate","directory","disa", + "dumpchan","eagi","echo","endwhile","exec","execif","execiftime","exitwhile","extenspy", + "externalivr","festival","flash","followme","forkcdr","getcpeid","gosub","gosubif", + "goto","gotoif","gotoiftime","hangup","iax2provision","ices","importvar","incomplete", + "ivrdemo","jabberjoin","jabberleave","jabbersend","jabbersendgroup","jabberstatus", + "jack","log","macro","macroexclusive","macroexit","macroif","mailboxexists","meetme", + "meetmeadmin","meetmechanneladmin","meetmecount","milliwatt","minivmaccmess","minivmdelete", + "minivmgreet","minivmmwi","minivmnotify","minivmrecord","mixmonitor","monitor","morsecode", + "mp3player","mset","musiconhold","nbscat","nocdr","noop","odbc","odbc","odbcfinish", + "originate","ospauth","ospfinish","osplookup","ospnext","page","park","parkandannounce", + "parkedcall","pausemonitor","pausequeuemember","pickup","pickupchan","playback","playtones", + "privacymanager","proceeding","progress","queue","queuelog","raiseexception","read","readexten", + "readfile","receivefax","receivefax","receivefax","record","removequeuemember", + "resetcdr","retrydial","return","ringing","sayalpha","saycountedadj","saycountednoun", + "saycountpl","saydigits","saynumber","sayphonetic","sayunixtime","senddtmf","sendfax", + "sendfax","sendfax","sendimage","sendtext","sendurl","set","setamaflags", + "setcallerpres","setmusiconhold","sipaddheader","sipdtmfmode","sipremoveheader","skel", + "slastation","slatrunk","sms","softhangup","speechactivategrammar","speechbackground", + "speechcreate","speechdeactivategrammar","speechdestroy","speechloadgrammar","speechprocessingsound", + "speechstart","speechunloadgrammar","stackpop","startmusiconhold","stopmixmonitor","stopmonitor", + "stopmusiconhold","stopplaytones","system","testclient","testserver","transfer","tryexec", + "trysystem","unpausemonitor","unpausequeuemember","userevent","verbose","vmauthenticate", + "vmsayname","voicemail","voicemailmain","wait","waitexten","waitfornoise","waitforring", + "waitforsilence","waitmusiconhold","waituntil","while","zapateller" + ]; + + function basicToken(stream,state){ + var cur = ''; + var ch = ''; + ch = stream.next(); + // comment + if(ch == ";") { + stream.skipToEnd(); + return "comment"; + } + // context + if(ch == '[') { + stream.skipTo(']'); + stream.eat(']'); + return "header"; + } + // string + if(ch == '"') { + stream.skipTo('"'); + return "string"; + } + if(ch == "'") { + stream.skipTo("'"); + return "string-2"; + } + // dialplan commands + if(ch == '#') { + stream.eatWhile(/\w/); + cur = stream.current(); + if(dpcmd.indexOf(cur) !== -1) { + stream.skipToEnd(); + return "strong"; + } + } + // application args + if(ch == '$'){ + var ch1 = stream.peek(); + if(ch1 == '{'){ + stream.skipTo('}'); + stream.eat('}'); + return "variable-3"; + } + } + // extension + stream.eatWhile(/\w/); + cur = stream.current(); + if(atoms.indexOf(cur) !== -1) { + state.extenStart = true; + switch(cur) { + case 'same': state.extenSame = true; break; + case 'include': + case 'switch': + case 'ignorepat': + state.extenInclude = true;break; + default:break; + } + return "atom"; + } + } + + return { + startState: function() { + return { + extenStart: false, + extenSame: false, + extenInclude: false, + extenExten: false, + extenPriority: false, + extenApplication: false + }; + }, + token: function(stream, state) { + + var cur = ''; + var ch = ''; + if(stream.eatSpace()) return null; + // extension started + if(state.extenStart){ + stream.eatWhile(/[^\s]/); + cur = stream.current(); + if(/^=>?$/.test(cur)){ + state.extenExten = true; + state.extenStart = false; + return "strong"; + } else { + state.extenStart = false; + stream.skipToEnd(); + return "error"; + } + } else if(state.extenExten) { + // set exten and priority + state.extenExten = false; + state.extenPriority = true; + stream.eatWhile(/[^,]/); + if(state.extenInclude) { + stream.skipToEnd(); + state.extenPriority = false; + state.extenInclude = false; + } + if(state.extenSame) { + state.extenPriority = false; + state.extenSame = false; + state.extenApplication = true; + } + return "tag"; + } else if(state.extenPriority) { + state.extenPriority = false; + state.extenApplication = true; + ch = stream.next(); // get comma + if(state.extenSame) return null; + stream.eatWhile(/[^,]/); + return "number"; + } else if(state.extenApplication) { + stream.eatWhile(/,/); + cur = stream.current(); + if(cur === ',') return null; + stream.eatWhile(/\w/); + cur = stream.current().toLowerCase(); + state.extenApplication = false; + if(apps.indexOf(cur) !== -1){ + return "def strong"; + } + } else{ + return basicToken(stream,state); + } + + return null; + } + }; +}); + +CodeMirror.defineMIME("text/x-asterisk", "asterisk"); diff --git a/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/asterisk/index.html b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/asterisk/index.html new file mode 100644 index 000000000..0a796a011 --- /dev/null +++ b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/asterisk/index.html @@ -0,0 +1,142 @@ + + + + + CodeMirror: Asterisk dialplan mode + + + + + + + +

CodeMirror: Asterisk dialplan mode

+
+ + +

MIME types defined: text/x-asterisk.

+ + + 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.

+ +

MIME types defined: text/x-csrc + (C code), text/x-c++src (C++ + code), text/x-java (Java + code), text/x-csharp (C#).

+ + diff --git a/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/clike/scala.html b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/clike/scala.html new file mode 100644 index 000000000..f3c7eea49 --- /dev/null +++ b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/clike/scala.html @@ -0,0 +1,767 @@ + + + + + CodeMirror: C-like mode + + + + + + + + + +
+ +
+ + + + diff --git a/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/clojure/clojure.js b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/clojure/clojure.js new file mode 100644 index 000000000..ee22a12fe --- /dev/null +++ b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/clojure/clojure.js @@ -0,0 +1,224 @@ +/** + * Author: Hans Engel + * Branched from CodeMirror's Scheme mode (by Koh Zi Han, based on implementation by Koh Zi Chun) + */ +CodeMirror.defineMode("clojure", function () { + var BUILTIN = "builtin", COMMENT = "comment", STRING = "string", CHARACTER = "string-2", + ATOM = "atom", NUMBER = "number", BRACKET = "bracket", KEYWORD = "keyword"; + var INDENT_WORD_SKIP = 2; + + function makeKeywords(str) { + var obj = {}, words = str.split(" "); + for (var i = 0; i < words.length; ++i) obj[words[i]] = true; + return obj; + } + + var atoms = makeKeywords("true false nil"); + + var keywords = makeKeywords( + "defn defn- def def- defonce defmulti defmethod defmacro defstruct deftype defprotocol defrecord defproject deftest slice defalias defhinted defmacro- defn-memo defnk defnk defonce- defunbound defunbound- defvar defvar- let letfn do case cond condp for loop recur when when-not when-let when-first if if-let if-not . .. -> ->> doto and or dosync doseq dotimes dorun doall load import unimport ns in-ns refer try catch finally throw with-open with-local-vars binding gen-class gen-and-load-class gen-and-save-class handler-case handle"); + + var builtins = makeKeywords( + "* *' *1 *2 *3 *agent* *allow-unresolved-vars* *assert* *clojure-version* *command-line-args* *compile-files* *compile-path* *compiler-options* *data-readers* *e *err* *file* *flush-on-newline* *fn-loader* *in* *math-context* *ns* *out* *print-dup* *print-length* *print-level* *print-meta* *print-readably* *read-eval* *source-path* *unchecked-math* *use-context-classloader* *verbose-defrecords* *warn-on-reflection* + +' - -' -> ->> ->ArrayChunk ->Vec ->VecNode ->VecSeq -cache-protocol-fn -reset-methods .. / < <= = == > >= EMPTY-NODE accessor aclone add-classpath add-watch agent agent-error agent-errors aget alength alias all-ns alter alter-meta! alter-var-root amap ancestors and apply areduce array-map aset aset-boolean aset-byte aset-char aset-double aset-float aset-int aset-long aset-short assert assoc assoc! assoc-in associative? atom await await-for await1 bases bean bigdec bigint biginteger binding bit-and bit-and-not bit-clear bit-flip bit-not bit-or bit-set bit-shift-left bit-shift-right bit-test bit-xor boolean boolean-array booleans bound-fn bound-fn* bound? butlast byte byte-array bytes case cast char char-array char-escape-string char-name-string char? chars chunk chunk-append chunk-buffer chunk-cons chunk-first chunk-next chunk-rest chunked-seq? class class? clear-agent-errors clojure-version coll? comment commute comp comparator compare compare-and-set! compile complement concat cond condp conj conj! cons constantly construct-proxy contains? count counted? create-ns create-struct cycle dec dec' decimal? declare default-data-readers definline definterface defmacro defmethod defmulti defn defn- defonce defprotocol defrecord defstruct deftype delay delay? deliver denominator deref derive descendants destructure disj disj! dissoc dissoc! distinct distinct? doall dorun doseq dosync dotimes doto double double-array doubles drop drop-last drop-while empty empty? ensure enumeration-seq error-handler error-mode eval even? every-pred every? ex-data ex-info extend extend-protocol extend-type extenders extends? false? ffirst file-seq filter filterv find find-keyword find-ns find-protocol-impl find-protocol-method find-var first flatten float float-array float? floats flush fn fn? fnext fnil for force format frequencies future future-call future-cancel future-cancelled? future-done? future? gen-class gen-interface gensym get get-in get-method get-proxy-class get-thread-bindings get-validator group-by hash hash-combine hash-map hash-set identical? identity if-let if-not ifn? import in-ns inc inc' init-proxy instance? int int-array integer? interleave intern interpose into into-array ints io! isa? iterate iterator-seq juxt keep keep-indexed key keys keyword keyword? last lazy-cat lazy-seq let letfn line-seq list list* list? load load-file load-reader load-string loaded-libs locking long long-array longs loop macroexpand macroexpand-1 make-array make-hierarchy map map-indexed map? mapcat mapv max max-key memfn memoize merge merge-with meta method-sig methods min min-key mod munge name namespace namespace-munge neg? newline next nfirst nil? nnext not not-any? not-empty not-every? not= ns ns-aliases ns-imports ns-interns ns-map ns-name ns-publics ns-refers ns-resolve ns-unalias ns-unmap nth nthnext nthrest num number? numerator object-array odd? or parents partial partition partition-all partition-by pcalls peek persistent! pmap pop pop! pop-thread-bindings pos? pr pr-str prefer-method prefers primitives-classnames print print-ctor print-dup print-method print-simple print-str printf println println-str prn prn-str promise proxy proxy-call-with-super proxy-mappings proxy-name proxy-super push-thread-bindings pvalues quot rand rand-int rand-nth range ratio? rational? rationalize re-find re-groups re-matcher re-matches re-pattern re-seq read read-line read-string realized? reduce reduce-kv reductions ref ref-history-count ref-max-history ref-min-history ref-set refer refer-clojure reify release-pending-sends rem remove remove-all-methods remove-method remove-ns remove-watch repeat repeatedly replace replicate require reset! reset-meta! resolve rest restart-agent resultset-seq reverse reversible? rseq rsubseq satisfies? second select-keys send send-off seq seq? seque sequence sequential? set set-error-handler! set-error-mode! set-validator! set? short short-array shorts shuffle shutdown-agents slurp some some-fn sort sort-by sorted-map sorted-map-by sorted-set sorted-set-by sorted? special-symbol? spit split-at split-with str string? struct struct-map subs subseq subvec supers swap! symbol symbol? sync take take-last take-nth take-while test the-ns thread-bound? time to-array to-array-2d trampoline transient tree-seq true? type unchecked-add unchecked-add-int unchecked-byte unchecked-char unchecked-dec unchecked-dec-int unchecked-divide-int unchecked-double unchecked-float unchecked-inc unchecked-inc-int unchecked-int unchecked-long unchecked-multiply unchecked-multiply-int unchecked-negate unchecked-negate-int unchecked-remainder-int unchecked-short unchecked-subtract unchecked-subtract-int underive unquote unquote-splicing update-in update-proxy use val vals var-get var-set var? vary-meta vec vector vector-of vector? when when-first when-let when-not while with-bindings with-bindings* with-in-str with-loading-context with-local-vars with-meta with-open with-out-str with-precision with-redefs with-redefs-fn xml-seq zero? zipmap *default-data-reader-fn* as-> cond-> cond->> reduced reduced? send-via set-agent-send-executor! set-agent-send-off-executor! some-> some->>"); + + var indentKeys = makeKeywords( + // Built-ins + "ns fn def defn defmethod bound-fn if if-not case condp when while when-not when-first do future comment doto locking proxy with-open with-precision reify deftype defrecord defprotocol extend extend-protocol extend-type try catch " + + + // Binding forms + "let letfn binding loop for doseq dotimes when-let if-let " + + + // Data structures + "defstruct struct-map assoc " + + + // clojure.test + "testing deftest " + + + // contrib + "handler-case handle dotrace deftrace"); + + var tests = { + digit: /\d/, + digit_or_colon: /[\d:]/, + hex: /[0-9a-f]/i, + sign: /[+-]/, + exponent: /e/i, + keyword_char: /[^\s\(\[\;\)\]]/, + symbol: /[\w*+!\-\._?:\/]/ + }; + + function stateStack(indent, type, prev) { // represents a state stack object + this.indent = indent; + this.type = type; + this.prev = prev; + } + + function pushStack(state, indent, type) { + state.indentStack = new stateStack(indent, type, state.indentStack); + } + + function popStack(state) { + state.indentStack = state.indentStack.prev; + } + + function isNumber(ch, stream){ + // hex + if ( ch === '0' && stream.eat(/x/i) ) { + stream.eatWhile(tests.hex); + return true; + } + + // leading sign + if ( ( ch == '+' || ch == '-' ) && ( tests.digit.test(stream.peek()) ) ) { + stream.eat(tests.sign); + ch = stream.next(); + } + + if ( tests.digit.test(ch) ) { + stream.eat(ch); + stream.eatWhile(tests.digit); + + if ( '.' == stream.peek() ) { + stream.eat('.'); + stream.eatWhile(tests.digit); + } + + if ( stream.eat(tests.exponent) ) { + stream.eat(tests.sign); + stream.eatWhile(tests.digit); + } + + return true; + } + + return false; + } + + // Eat character that starts after backslash \ + function eatCharacter(stream) { + var first = stream.next(); + // Read special literals: backspace, newline, space, return. + // Just read all lowercase letters. + if (first.match(/[a-z]/) && stream.match(/[a-z]+/, true)) { + return; + } + // Read unicode character: \u1000 \uA0a1 + if (first === "u") { + stream.match(/[0-9a-z]{4}/i, true); + } + } + + return { + startState: function () { + return { + indentStack: null, + indentation: 0, + mode: false + }; + }, + + token: function (stream, state) { + if (state.indentStack == null && stream.sol()) { + // update indentation, but only if indentStack is empty + state.indentation = stream.indentation(); + } + + // skip spaces + if (stream.eatSpace()) { + return null; + } + var returnType = null; + + switch(state.mode){ + case "string": // multi-line string parsing mode + var next, escaped = false; + while ((next = stream.next()) != null) { + if (next == "\"" && !escaped) { + + state.mode = false; + break; + } + escaped = !escaped && next == "\\"; + } + returnType = STRING; // continue on in string mode + break; + default: // default parsing mode + var ch = stream.next(); + + if (ch == "\"") { + state.mode = "string"; + returnType = STRING; + } else if (ch == "\\") { + eatCharacter(stream); + returnType = CHARACTER; + } else if (ch == "'" && !( tests.digit_or_colon.test(stream.peek()) )) { + returnType = ATOM; + } else if (ch == ";") { // comment + stream.skipToEnd(); // rest of the line is a comment + returnType = COMMENT; + } else if (isNumber(ch,stream)){ + returnType = NUMBER; + } else if (ch == "(" || ch == "[" || ch == "{" ) { + var keyWord = '', indentTemp = stream.column(), letter; + /** + Either + (indent-word .. + (non-indent-word .. + (;something else, bracket, etc. + */ + + if (ch == "(") while ((letter = stream.eat(tests.keyword_char)) != null) { + keyWord += letter; + } + + if (keyWord.length > 0 && (indentKeys.propertyIsEnumerable(keyWord) || + /^(?:def|with)/.test(keyWord))) { // indent-word + pushStack(state, indentTemp + INDENT_WORD_SKIP, ch); + } else { // non-indent word + // we continue eating the spaces + stream.eatSpace(); + if (stream.eol() || stream.peek() == ";") { + // nothing significant after + // we restart indentation 1 space after + pushStack(state, indentTemp + 1, ch); + } else { + pushStack(state, indentTemp + stream.current().length, ch); // else we match + } + } + stream.backUp(stream.current().length - 1); // undo all the eating + + returnType = BRACKET; + } else if (ch == ")" || ch == "]" || ch == "}") { + returnType = BRACKET; + if (state.indentStack != null && state.indentStack.type == (ch == ")" ? "(" : (ch == "]" ? "[" :"{"))) { + popStack(state); + } + } else if ( ch == ":" ) { + stream.eatWhile(tests.symbol); + return ATOM; + } else { + stream.eatWhile(tests.symbol); + + if (keywords && keywords.propertyIsEnumerable(stream.current())) { + returnType = KEYWORD; + } else if (builtins && builtins.propertyIsEnumerable(stream.current())) { + returnType = BUILTIN; + } else if (atoms && atoms.propertyIsEnumerable(stream.current())) { + returnType = ATOM; + } else returnType = null; + } + } + + return returnType; + }, + + indent: function (state) { + if (state.indentStack == null) return state.indentation; + return state.indentStack.indent; + }, + + lineComment: ";;" + }; +}); + +CodeMirror.defineMIME("text/x-clojure", "clojure"); diff --git a/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/clojure/index.html b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/clojure/index.html new file mode 100644 index 000000000..bfe6fc955 --- /dev/null +++ b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/clojure/index.html @@ -0,0 +1,76 @@ + + + + + CodeMirror: Clojure mode + + + + + + + +

CodeMirror: Clojure mode

+
+ + +

MIME types defined: text/x-clojure.

+ + + diff --git a/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/cobol/cobol.js b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/cobol/cobol.js new file mode 100644 index 000000000..d92491dde --- /dev/null +++ b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/cobol/cobol.js @@ -0,0 +1,240 @@ +/** + * Author: Gautam Mehta + * Branched from CodeMirror's Scheme mode + */ +CodeMirror.defineMode("cobol", function () { + var BUILTIN = "builtin", COMMENT = "comment", STRING = "string", + ATOM = "atom", NUMBER = "number", KEYWORD = "keyword", MODTAG = "header", + COBOLLINENUM = "def", PERIOD = "link"; + function makeKeywords(str) { + var obj = {}, words = str.split(" "); + for (var i = 0; i < words.length; ++i) obj[words[i]] = true; + return obj; + } + var atoms = makeKeywords("TRUE FALSE ZEROES ZEROS ZERO SPACES SPACE LOW-VALUE LOW-VALUES "); + var keywords = makeKeywords( + "ACCEPT ACCESS ACQUIRE ADD ADDRESS " + + "ADVANCING AFTER ALIAS ALL ALPHABET " + + "ALPHABETIC ALPHABETIC-LOWER ALPHABETIC-UPPER ALPHANUMERIC ALPHANUMERIC-EDITED " + + "ALSO ALTER ALTERNATE AND ANY " + + "ARE AREA AREAS ARITHMETIC ASCENDING " + + "ASSIGN AT ATTRIBUTE AUTHOR AUTO " + + "AUTO-SKIP AUTOMATIC B-AND B-EXOR B-LESS " + + "B-NOT B-OR BACKGROUND-COLOR BACKGROUND-COLOUR BEEP " + + "BEFORE BELL BINARY BIT BITS " + + "BLANK BLINK BLOCK BOOLEAN BOTTOM " + + "BY CALL CANCEL CD CF " + + "CH CHARACTER CHARACTERS CLASS CLOCK-UNITS " + + "CLOSE COBOL CODE CODE-SET COL " + + "COLLATING COLUMN COMMA COMMIT COMMITMENT " + + "COMMON COMMUNICATION COMP COMP-0 COMP-1 " + + "COMP-2 COMP-3 COMP-4 COMP-5 COMP-6 " + + "COMP-7 COMP-8 COMP-9 COMPUTATIONAL COMPUTATIONAL-0 " + + "COMPUTATIONAL-1 COMPUTATIONAL-2 COMPUTATIONAL-3 COMPUTATIONAL-4 COMPUTATIONAL-5 " + + "COMPUTATIONAL-6 COMPUTATIONAL-7 COMPUTATIONAL-8 COMPUTATIONAL-9 COMPUTE " + + "CONFIGURATION CONNECT CONSOLE CONTAINED CONTAINS " + + "CONTENT CONTINUE CONTROL CONTROL-AREA CONTROLS " + + "CONVERTING COPY CORR CORRESPONDING COUNT " + + "CRT CRT-UNDER CURRENCY CURRENT CURSOR " + + "DATA DATE DATE-COMPILED DATE-WRITTEN DAY " + + "DAY-OF-WEEK DB DB-ACCESS-CONTROL-KEY DB-DATA-NAME DB-EXCEPTION " + + "DB-FORMAT-NAME DB-RECORD-NAME DB-SET-NAME DB-STATUS DBCS " + + "DBCS-EDITED DE DEBUG-CONTENTS DEBUG-ITEM DEBUG-LINE " + + "DEBUG-NAME DEBUG-SUB-1 DEBUG-SUB-2 DEBUG-SUB-3 DEBUGGING " + + "DECIMAL-POINT DECLARATIVES DEFAULT DELETE DELIMITED " + + "DELIMITER DEPENDING DESCENDING DESCRIBED DESTINATION " + + "DETAIL DISABLE DISCONNECT DISPLAY DISPLAY-1 " + + "DISPLAY-2 DISPLAY-3 DISPLAY-4 DISPLAY-5 DISPLAY-6 " + + "DISPLAY-7 DISPLAY-8 DISPLAY-9 DIVIDE DIVISION " + + "DOWN DROP DUPLICATE DUPLICATES DYNAMIC " + + "EBCDIC EGI EJECT ELSE EMI " + + "EMPTY EMPTY-CHECK ENABLE END END. END-ACCEPT END-ACCEPT. " + + "END-ADD END-CALL END-COMPUTE END-DELETE END-DISPLAY " + + "END-DIVIDE END-EVALUATE END-IF END-INVOKE END-MULTIPLY " + + "END-OF-PAGE END-PERFORM END-READ END-RECEIVE END-RETURN " + + "END-REWRITE END-SEARCH END-START END-STRING END-SUBTRACT " + + "END-UNSTRING END-WRITE END-XML ENTER ENTRY " + + "ENVIRONMENT EOP EQUAL EQUALS ERASE " + + "ERROR ESI EVALUATE EVERY EXCEEDS " + + "EXCEPTION EXCLUSIVE EXIT EXTEND EXTERNAL " + + "EXTERNALLY-DESCRIBED-KEY FD FETCH FILE FILE-CONTROL " + + "FILE-STREAM FILES FILLER FINAL FIND " + + "FINISH FIRST FOOTING FOR FOREGROUND-COLOR " + + "FOREGROUND-COLOUR FORMAT FREE FROM FULL " + + "FUNCTION GENERATE GET GIVING GLOBAL " + + "GO GOBACK GREATER GROUP HEADING " + + "HIGH-VALUE HIGH-VALUES HIGHLIGHT I-O I-O-CONTROL " + + "ID IDENTIFICATION IF IN INDEX " + + "INDEX-1 INDEX-2 INDEX-3 INDEX-4 INDEX-5 " + + "INDEX-6 INDEX-7 INDEX-8 INDEX-9 INDEXED " + + "INDIC INDICATE INDICATOR INDICATORS INITIAL " + + "INITIALIZE INITIATE INPUT INPUT-OUTPUT INSPECT " + + "INSTALLATION INTO INVALID INVOKE IS " + + "JUST JUSTIFIED KANJI KEEP KEY " + + "LABEL LAST LD LEADING LEFT " + + "LEFT-JUSTIFY LENGTH LENGTH-CHECK LESS LIBRARY " + + "LIKE LIMIT LIMITS LINAGE LINAGE-COUNTER " + + "LINE LINE-COUNTER LINES LINKAGE LOCAL-STORAGE " + + "LOCALE LOCALLY LOCK " + + "MEMBER MEMORY MERGE MESSAGE METACLASS " + + "MODE MODIFIED MODIFY MODULES MOVE " + + "MULTIPLE MULTIPLY NATIONAL NATIVE NEGATIVE " + + "NEXT NO NO-ECHO NONE NOT " + + "NULL NULL-KEY-MAP NULL-MAP NULLS NUMBER " + + "NUMERIC NUMERIC-EDITED OBJECT OBJECT-COMPUTER OCCURS " + + "OF OFF OMITTED ON ONLY " + + "OPEN OPTIONAL OR ORDER ORGANIZATION " + + "OTHER OUTPUT OVERFLOW OWNER PACKED-DECIMAL " + + "PADDING PAGE PAGE-COUNTER PARSE PERFORM " + + "PF PH PIC PICTURE PLUS " + + "POINTER POSITION POSITIVE PREFIX PRESENT " + + "PRINTING PRIOR PROCEDURE PROCEDURE-POINTER PROCEDURES " + + "PROCEED PROCESS PROCESSING PROGRAM PROGRAM-ID " + + "PROMPT PROTECTED PURGE QUEUE QUOTE " + + "QUOTES RANDOM RD READ READY " + + "REALM RECEIVE RECONNECT RECORD RECORD-NAME " + + "RECORDS RECURSIVE REDEFINES REEL REFERENCE " + + "REFERENCE-MONITOR REFERENCES RELATION RELATIVE RELEASE " + + "REMAINDER REMOVAL RENAMES REPEATED REPLACE " + + "REPLACING REPORT REPORTING REPORTS REPOSITORY " + + "REQUIRED RERUN RESERVE RESET RETAINING " + + "RETRIEVAL RETURN RETURN-CODE RETURNING REVERSE-VIDEO " + + "REVERSED REWIND REWRITE RF RH " + + "RIGHT RIGHT-JUSTIFY ROLLBACK ROLLING ROUNDED " + + "RUN SAME SCREEN SD SEARCH " + + "SECTION SECURE SECURITY SEGMENT SEGMENT-LIMIT " + + "SELECT SEND SENTENCE SEPARATE SEQUENCE " + + "SEQUENTIAL SET SHARED SIGN SIZE " + + "SKIP1 SKIP2 SKIP3 SORT SORT-MERGE " + + "SORT-RETURN SOURCE SOURCE-COMPUTER SPACE-FILL " + + "SPECIAL-NAMES STANDARD STANDARD-1 STANDARD-2 " + + "START STARTING STATUS STOP STORE " + + "STRING SUB-QUEUE-1 SUB-QUEUE-2 SUB-QUEUE-3 SUB-SCHEMA " + + "SUBFILE SUBSTITUTE SUBTRACT SUM SUPPRESS " + + "SYMBOLIC SYNC SYNCHRONIZED SYSIN SYSOUT " + + "TABLE TALLYING TAPE TENANT TERMINAL " + + "TERMINATE TEST TEXT THAN THEN " + + "THROUGH THRU TIME TIMES TITLE " + + "TO TOP TRAILING TRAILING-SIGN TRANSACTION " + + "TYPE TYPEDEF UNDERLINE UNEQUAL UNIT " + + "UNSTRING UNTIL UP UPDATE UPON " + + "USAGE USAGE-MODE USE USING VALID " + + "VALIDATE VALUE VALUES VARYING VLR " + + "WAIT WHEN WHEN-COMPILED WITH WITHIN " + + "WORDS WORKING-STORAGE WRITE XML XML-CODE " + + "XML-EVENT XML-NTEXT XML-TEXT ZERO ZERO-FILL " ); + + var builtins = makeKeywords("- * ** / + < <= = > >= "); + var tests = { + digit: /\d/, + digit_or_colon: /[\d:]/, + hex: /[0-9a-f]/i, + sign: /[+-]/, + exponent: /e/i, + keyword_char: /[^\s\(\[\;\)\]]/, + symbol: /[\w*+\-]/ + }; + function isNumber(ch, stream){ + // hex + if ( ch === '0' && stream.eat(/x/i) ) { + stream.eatWhile(tests.hex); + return true; + } + // leading sign + if ( ( ch == '+' || ch == '-' ) && ( tests.digit.test(stream.peek()) ) ) { + stream.eat(tests.sign); + ch = stream.next(); + } + if ( tests.digit.test(ch) ) { + stream.eat(ch); + stream.eatWhile(tests.digit); + if ( '.' == stream.peek()) { + stream.eat('.'); + stream.eatWhile(tests.digit); + } + if ( stream.eat(tests.exponent) ) { + stream.eat(tests.sign); + stream.eatWhile(tests.digit); + } + return true; + } + return false; + } + return { + startState: function () { + return { + indentStack: null, + indentation: 0, + mode: false + }; + }, + token: function (stream, state) { + if (state.indentStack == null && stream.sol()) { + // update indentation, but only if indentStack is empty + state.indentation = 6 ; //stream.indentation(); + } + // skip spaces + if (stream.eatSpace()) { + return null; + } + var returnType = null; + switch(state.mode){ + case "string": // multi-line string parsing mode + var next = false; + while ((next = stream.next()) != null) { + if (next == "\"" || next == "\'") { + state.mode = false; + break; + } + } + returnType = STRING; // continue on in string mode + break; + default: // default parsing mode + var ch = stream.next(); + var col = stream.column(); + if (col >= 0 && col <= 5) { + returnType = COBOLLINENUM; + } else if (col >= 72 && col <= 79) { + stream.skipToEnd(); + returnType = MODTAG; + } else if (ch == "*" && col == 6) { // comment + stream.skipToEnd(); // rest of the line is a comment + returnType = COMMENT; + } else if (ch == "\"" || ch == "\'") { + state.mode = "string"; + returnType = STRING; + } else if (ch == "'" && !( tests.digit_or_colon.test(stream.peek()) )) { + returnType = ATOM; + } else if (ch == ".") { + returnType = PERIOD; + } else if (isNumber(ch,stream)){ + returnType = NUMBER; + } else { + if (stream.current().match(tests.symbol)) { + while (col < 71) { + if (stream.eat(tests.symbol) === undefined) { + break; + } else { + col++; + } + } + } + if (keywords && keywords.propertyIsEnumerable(stream.current().toUpperCase())) { + returnType = KEYWORD; + } else if (builtins && builtins.propertyIsEnumerable(stream.current().toUpperCase())) { + returnType = BUILTIN; + } else if (atoms && atoms.propertyIsEnumerable(stream.current().toUpperCase())) { + returnType = ATOM; + } else returnType = null; + } + } + return returnType; + }, + indent: function (state) { + if (state.indentStack == null) return state.indentation; + return state.indentStack.indent; + } + }; +}); + +CodeMirror.defineMIME("text/x-cobol", "cobol"); diff --git a/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/cobol/index.html b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/cobol/index.html new file mode 100644 index 000000000..71cc2fa15 --- /dev/null +++ b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/cobol/index.html @@ -0,0 +1,195 @@ + + + + + CodeMirror: COBOL mode + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Select Theme Select Font Size + + + + +

+ + + + diff --git a/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/coffeescript/LICENSE b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/coffeescript/LICENSE new file mode 100644 index 000000000..977e284e0 --- /dev/null +++ b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/coffeescript/LICENSE @@ -0,0 +1,22 @@ +The MIT License + +Copyright (c) 2011 Jeff Pickhardt +Modified from the Python CodeMirror mode, 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/coffeescript/coffeescript.js b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/coffeescript/coffeescript.js new file mode 100644 index 000000000..28f5ad7d6 --- /dev/null +++ b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/coffeescript/coffeescript.js @@ -0,0 +1,347 @@ +/** + * Link to the project's GitHub page: + * https://github.com/pickhardt/coffeescript-codemirror-mode + */ +CodeMirror.defineMode('coffeescript', function(conf) { + var ERRORCLASS = 'error'; + + function wordRegexp(words) { + return new RegExp("^((" + words.join(")|(") + "))\\b"); + } + + var singleOperators = new RegExp("^[\\+\\-\\*/%&|\\^~<>!\?]"); + var singleDelimiters = new RegExp('^[\\(\\)\\[\\]\\{\\},:`=;\\.]'); + var doubleOperators = new RegExp("^((\->)|(\=>)|(\\+\\+)|(\\+\\=)|(\\-\\-)|(\\-\\=)|(\\*\\*)|(\\*\\=)|(\\/\\/)|(\\/\\=)|(==)|(!=)|(<=)|(>=)|(<>)|(<<)|(>>)|(//))"); + var doubleDelimiters = new RegExp("^((\\.\\.)|(\\+=)|(\\-=)|(\\*=)|(%=)|(/=)|(&=)|(\\|=)|(\\^=))"); + var tripleDelimiters = new RegExp("^((\\.\\.\\.)|(//=)|(>>=)|(<<=)|(\\*\\*=))"); + var identifiers = new RegExp("^[_A-Za-z$][_A-Za-z$0-9]*"); + var properties = new RegExp("^(@|this\.)[_A-Za-z$][_A-Za-z$0-9]*"); + + var wordOperators = wordRegexp(['and', 'or', 'not', + 'is', 'isnt', 'in', + 'instanceof', 'typeof']); + var indentKeywords = ['for', 'while', 'loop', 'if', 'unless', 'else', + 'switch', 'try', 'catch', 'finally', 'class']; + var commonKeywords = ['break', 'by', 'continue', 'debugger', 'delete', + 'do', 'in', 'of', 'new', 'return', 'then', + 'this', 'throw', 'when', 'until']; + + var keywords = wordRegexp(indentKeywords.concat(commonKeywords)); + + indentKeywords = wordRegexp(indentKeywords); + + + var stringPrefixes = new RegExp("^('{3}|\"{3}|['\"])"); + var regexPrefixes = new RegExp("^(/{3}|/)"); + var commonConstants = ['Infinity', 'NaN', 'undefined', 'null', 'true', 'false', 'on', 'off', 'yes', 'no']; + var constants = wordRegexp(commonConstants); + + // Tokenizers + function tokenBase(stream, state) { + // Handle scope changes + if (stream.sol()) { + var scopeOffset = state.scopes[0].offset; + if (stream.eatSpace()) { + var lineOffset = stream.indentation(); + if (lineOffset > scopeOffset) { + return 'indent'; + } else if (lineOffset < scopeOffset) { + return 'dedent'; + } + return null; + } else { + if (scopeOffset > 0) { + dedent(stream, state); + } + } + } + if (stream.eatSpace()) { + return null; + } + + var ch = stream.peek(); + + // Handle docco title comment (single line) + if (stream.match("####")) { + stream.skipToEnd(); + return 'comment'; + } + + // Handle multi line comments + if (stream.match("###")) { + state.tokenize = longComment; + return state.tokenize(stream, state); + } + + // Single line comment + if (ch === '#') { + stream.skipToEnd(); + return 'comment'; + } + + // Handle number literals + if (stream.match(/^-?[0-9\.]/, false)) { + var floatLiteral = false; + // Floats + if (stream.match(/^-?\d*\.\d+(e[\+\-]?\d+)?/i)) { + floatLiteral = true; + } + if (stream.match(/^-?\d+\.\d*/)) { + floatLiteral = true; + } + if (stream.match(/^-?\.\d+/)) { + floatLiteral = true; + } + + if (floatLiteral) { + // prevent from getting extra . on 1.. + if (stream.peek() == "."){ + stream.backUp(1); + } + return 'number'; + } + // Integers + var intLiteral = false; + // Hex + if (stream.match(/^-?0x[0-9a-f]+/i)) { + intLiteral = true; + } + // Decimal + if (stream.match(/^-?[1-9]\d*(e[\+\-]?\d+)?/)) { + intLiteral = true; + } + // Zero by itself with no other piece of number. + if (stream.match(/^-?0(?![\dx])/i)) { + intLiteral = true; + } + if (intLiteral) { + return 'number'; + } + } + + // Handle strings + if (stream.match(stringPrefixes)) { + state.tokenize = tokenFactory(stream.current(), 'string'); + return state.tokenize(stream, state); + } + // Handle regex literals + if (stream.match(regexPrefixes)) { + if (stream.current() != '/' || stream.match(/^.*\//, false)) { // prevent highlight of division + state.tokenize = tokenFactory(stream.current(), 'string-2'); + return state.tokenize(stream, state); + } else { + stream.backUp(1); + } + } + + // Handle operators and delimiters + if (stream.match(tripleDelimiters) || stream.match(doubleDelimiters)) { + return 'punctuation'; + } + if (stream.match(doubleOperators) + || stream.match(singleOperators) + || stream.match(wordOperators)) { + return 'operator'; + } + if (stream.match(singleDelimiters)) { + return 'punctuation'; + } + + if (stream.match(constants)) { + return 'atom'; + } + + if (stream.match(keywords)) { + return 'keyword'; + } + + if (stream.match(identifiers)) { + return 'variable'; + } + + if (stream.match(properties)) { + return 'property'; + } + + // Handle non-detected items + stream.next(); + return ERRORCLASS; + } + + function tokenFactory(delimiter, outclass) { + var singleline = delimiter.length == 1; + return function(stream, state) { + while (!stream.eol()) { + stream.eatWhile(/[^'"\/\\]/); + if (stream.eat('\\')) { + stream.next(); + if (singleline && stream.eol()) { + return outclass; + } + } else if (stream.match(delimiter)) { + state.tokenize = tokenBase; + return outclass; + } else { + stream.eat(/['"\/]/); + } + } + if (singleline) { + if (conf.mode.singleLineStringErrors) { + outclass = ERRORCLASS; + } else { + state.tokenize = tokenBase; + } + } + return outclass; + }; + } + + function longComment(stream, state) { + while (!stream.eol()) { + stream.eatWhile(/[^#]/); + if (stream.match("###")) { + state.tokenize = tokenBase; + break; + } + stream.eatWhile("#"); + } + return "comment"; + } + + function indent(stream, state, type) { + type = type || 'coffee'; + var indentUnit = 0; + if (type === 'coffee') { + for (var i = 0; i < state.scopes.length; i++) { + if (state.scopes[i].type === 'coffee') { + indentUnit = state.scopes[i].offset + conf.indentUnit; + break; + } + } + } else { + indentUnit = stream.column() + stream.current().length; + } + state.scopes.unshift({ + offset: indentUnit, + type: type + }); + } + + function dedent(stream, state) { + if (state.scopes.length == 1) return; + if (state.scopes[0].type === 'coffee') { + var _indent = stream.indentation(); + var _indent_index = -1; + for (var i = 0; i < state.scopes.length; ++i) { + if (_indent === state.scopes[i].offset) { + _indent_index = i; + break; + } + } + if (_indent_index === -1) { + return true; + } + while (state.scopes[0].offset !== _indent) { + state.scopes.shift(); + } + return false; + } else { + state.scopes.shift(); + return false; + } + } + + function tokenLexer(stream, state) { + var style = state.tokenize(stream, state); + var current = stream.current(); + + // Handle '.' connected identifiers + if (current === '.') { + style = state.tokenize(stream, state); + current = stream.current(); + if (style === 'variable') { + return 'variable'; + } else { + return ERRORCLASS; + } + } + + // Handle scope changes. + if (current === 'return') { + state.dedent += 1; + } + if (((current === '->' || current === '=>') && + !state.lambda && + state.scopes[0].type == 'coffee' && + stream.peek() === '') + || style === 'indent') { + indent(stream, state); + } + var delimiter_index = '[({'.indexOf(current); + if (delimiter_index !== -1) { + indent(stream, state, '])}'.slice(delimiter_index, delimiter_index+1)); + } + if (indentKeywords.exec(current)){ + indent(stream, state); + } + if (current == 'then'){ + dedent(stream, state); + } + + + if (style === 'dedent') { + if (dedent(stream, state)) { + return ERRORCLASS; + } + } + delimiter_index = '])}'.indexOf(current); + if (delimiter_index !== -1) { + if (dedent(stream, state)) { + return ERRORCLASS; + } + } + if (state.dedent > 0 && stream.eol() && state.scopes[0].type == 'coffee') { + if (state.scopes.length > 1) state.scopes.shift(); + state.dedent -= 1; + } + + return style; + } + + var external = { + startState: function(basecolumn) { + return { + tokenize: tokenBase, + scomixerp: [{offset:basecolumn || 0, type:'coffee'}], + lastToken: null, + lambda: false, + dedent: 0 + }; + }, + + token: function(stream, state) { + var style = tokenLexer(stream, state); + + state.lastToken = {style:style, content: stream.current()}; + + if (stream.eol() && stream.lambda) { + state.lambda = false; + } + + return style; + }, + + indent: function(state) { + if (state.tokenize != tokenBase) { + return 0; + } + + return state.scopes[0].offset; + }, + + lineComment: "#" + }; + return external; +}); + +CodeMirror.defineMIME('text/x-coffeescript', 'coffeescript'); diff --git a/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/coffeescript/index.html b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/coffeescript/index.html new file mode 100644 index 000000000..ee72b8d2f --- /dev/null +++ b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/coffeescript/index.html @@ -0,0 +1,728 @@ + + + + + CodeMirror: CoffeeScript mode + + + + + + + +

CodeMirror: CoffeeScript mode

+
+ + +

MIME types defined: text/x-coffeescript.

+ +

The CoffeeScript mode was written by Jeff Pickhardt (license).

+ + + diff --git a/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/commonlisp/commonlisp.js b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/commonlisp/commonlisp.js new file mode 100644 index 000000000..8fa08c8ac --- /dev/null +++ b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/commonlisp/commonlisp.js @@ -0,0 +1,105 @@ +CodeMirror.defineMode("commonlisp", function (config) { + var assumeBody = /^with|^def|^do|^prog|case$|^cond$|bind$|when$|unless$/; + var numLiteral = /^(?:[+\-]?(?:\d+|\d*\.\d+)(?:[efd][+\-]?\d+)?|[+\-]?\d+(?:\/[+\-]?\d+)?|#b[+\-]?[01]+|#o[+\-]?[0-7]+|#x[+\-]?[\da-f]+)/; + var symbol = /[^\s'`,@()\[\]";]/; + var type; + + function readSym(stream) { + var ch; + while (ch = stream.next()) { + if (ch == "\\") stream.next(); + else if (!symbol.test(ch)) { stream.backUp(1); break; } + } + return stream.current(); + } + + function base(stream, state) { + if (stream.eatSpace()) {type = "ws"; return null;} + if (stream.match(numLiteral)) return "number"; + var ch = stream.next(); + if (ch == "\\") ch = stream.next(); + + if (ch == '"') return (state.tokenize = inString)(stream, state); + else if (ch == "(") { type = "open"; return "bracket"; } + else if (ch == ")" || ch == "]") { type = "close"; return "bracket"; } + else if (ch == ";") { stream.skipToEnd(); type = "ws"; return "comment"; } + else if (/['`,@]/.test(ch)) return null; + else if (ch == "|") { + if (stream.skipTo("|")) { stream.next(); return "symbol"; } + else { stream.skipToEnd(); return "error"; } + } else if (ch == "#") { + var ch = stream.next(); + if (ch == "[") { type = "open"; return "bracket"; } + else if (/[+\-=\.']/.test(ch)) return null; + else if (/\d/.test(ch) && stream.match(/^\d*#/)) return null; + else if (ch == "|") return (state.tokenize = inComment)(stream, state); + else if (ch == ":") { readSym(stream); return "meta"; } + else return "error"; + } else { + var name = readSym(stream); + if (name == ".") return null; + type = "symbol"; + if (name == "nil" || name == "t") return "atom"; + if (name.charAt(0) == ":") return "keyword"; + if (name.charAt(0) == "&") return "variable-2"; + return "variable"; + } + } + + function inString(stream, state) { + var escaped = false, next; + while (next = stream.next()) { + if (next == '"' && !escaped) { state.tokenize = base; break; } + escaped = !escaped && next == "\\"; + } + return "string"; + } + + function inComment(stream, state) { + var next, last; + while (next = stream.next()) { + if (next == "#" && last == "|") { state.tokenize = base; break; } + last = next; + } + type = "ws"; + return "comment"; + } + + return { + startState: function () { + return {ctx: {prev: null, start: 0, indentTo: 0}, tokenize: base}; + }, + + token: function (stream, state) { + if (stream.sol() && typeof state.ctx.indentTo != "number") + state.ctx.indentTo = state.ctx.start + 1; + + type = null; + var style = state.tokenize(stream, state); + if (type != "ws") { + if (state.ctx.indentTo == null) { + if (type == "symbol" && assumeBody.test(stream.current())) + state.ctx.indentTo = state.ctx.start + config.indentUnit; + else + state.ctx.indentTo = "next"; + } else if (state.ctx.indentTo == "next") { + state.ctx.indentTo = stream.column(); + } + } + if (type == "open") state.ctx = {prev: state.ctx, start: stream.column(), indentTo: null}; + else if (type == "close") state.ctx = state.ctx.prev || state.ctx; + return style; + }, + + indent: function (state, _textAfter) { + var i = state.ctx.indentTo; + return typeof i == "number" ? i : state.ctx.start + 1; + }, + + lineComment: ";;", + blockCommentStart: "#|", + blockCommentEnd: "|#" + }; +}); + +CodeMirror.defineMIME("text/x-common-lisp", "commonlisp"); diff --git a/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/commonlisp/index.html b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/commonlisp/index.html new file mode 100644 index 000000000..f9766a844 --- /dev/null +++ b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/commonlisp/index.html @@ -0,0 +1,165 @@ + + + + + CodeMirror: Common Lisp mode + + + + + + + +

CodeMirror: Common Lisp mode

+
+ + +

MIME types defined: text/x-common-lisp.

+ + + diff --git a/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/css/css.js b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/css/css.js new file mode 100644 index 000000000..aaf06fbc5 --- /dev/null +++ b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/css/css.js @@ -0,0 +1,606 @@ +CodeMirror.defineMode("css", function(config) { + return CodeMirror.getMode(config, "text/css"); +}); + +CodeMirror.defineMode("css-base", function(config, parserConfig) { + "use strict"; + + var indentUnit = config.indentUnit, + hooks = parserConfig.hooks || {}, + atMediaTypes = parserConfig.atMediaTypes || {}, + atMediaFeatures = parserConfig.atMediaFeatures || {}, + propertyKeywords = parserConfig.propertyKeywords || {}, + colorKeywords = parserConfig.colorKeywords || {}, + valueKeywords = parserConfig.valueKeywords || {}, + allowNested = !!parserConfig.allowNested, + type = null; + + function ret(style, tp) { type = tp; return style; } + + function tokenBase(stream, state) { + var ch = stream.next(); + if (hooks[ch]) { + // result[0] is style and result[1] is type + var result = hooks[ch](stream, state); + if (result !== false) return result; + } + if (ch == "@") {stream.eatWhile(/[\w\\\-]/); return ret("def", stream.current());} + else if (ch == "=") ret(null, "compare"); + else if ((ch == "~" || ch == "|") && stream.eat("=")) return ret(null, "compare"); + else if (ch == "\"" || ch == "'") { + state.tokenize = tokenString(ch); + return state.tokenize(stream, state); + } + else if (ch == "#") { + stream.eatWhile(/[\w\\\-]/); + return ret("atom", "hash"); + } + else if (ch == "!") { + stream.match(/^\s*\w*/); + return ret("keyword", "important"); + } + else if (/\d/.test(ch)) { + stream.eatWhile(/[\w.%]/); + return ret("number", "unit"); + } + else if (ch === "-") { + if (/\d/.test(stream.peek())) { + stream.eatWhile(/[\w.%]/); + return ret("number", "unit"); + } else if (stream.match(/^[^-]+-/)) { + return ret("meta", "meta"); + } + } + else if (/[,+>*\/]/.test(ch)) { + return ret(null, "select-op"); + } + else if (ch == "." && stream.match(/^-?[_a-z][_a-z0-9-]*/i)) { + return ret("qualifier", "qualifier"); + } + else if (ch == ":") { + return ret("operator", ch); + } + else if (/[;{}\[\]\(\)]/.test(ch)) { + return ret(null, ch); + } + else if (ch == "u" && stream.match("rl(")) { + stream.backUp(1); + state.tokenize = tokenParenthesized; + return ret("property", "variable"); + } + else { + stream.eatWhile(/[\w\\\-]/); + return ret("property", "variable"); + } + } + + function tokenString(quote, nonInclusive) { + return function(stream, state) { + var escaped = false, ch; + while ((ch = stream.next()) != null) { + if (ch == quote && !escaped) + break; + escaped = !escaped && ch == "\\"; + } + if (!escaped) { + if (nonInclusive) stream.backUp(1); + state.tokenize = tokenBase; + } + return ret("string", "string"); + }; + } + + function tokenParenthesized(stream, state) { + stream.next(); // Must be '(' + if (!stream.match(/\s*[\"\']/, false)) + state.tokenize = tokenString(")", true); + else + state.tokenize = tokenBase; + return ret(null, "("); + } + + return { + startState: function(base) { + return {tokenize: tokenBase, + baseIndent: base || 0, + stack: []}; + }, + + token: function(stream, state) { + + // Use these terms when applicable (see http://www.xanthir.com/blog/b4E50) + // + // rule** or **ruleset: + // A selector + braces combo, or an at-rule. + // + // declaration block: + // A sequence of declarations. + // + // declaration: + // A property + colon + value combo. + // + // property value: + // The entire value of a property. + // + // component value: + // A single piece of a property value. Like the 5px in + // text-shadow: 0 0 5px blue;. Can also refer to things that are + // multiple terms, like the 1-4 terms that make up the background-size + // portion of the background shorthand. + // + // term: + // The basic unit of author-facing CSS, like a single number (5), + // dimension (5px), string ("foo"), or function. Officially defined + // by the CSS 2.1 grammar (look for the 'term' production) + // + // + // simple selector: + // A single atomic selector, like a type selector, an attr selector, a + // class selector, etc. + // + // compound selector: + // One or more simple selectors without a combinator. div.example is + // compound, div > .example is not. + // + // complex selector: + // One or more compound selectors chained with combinators. + // + // combinator: + // The parts of selectors that express relationships. There are four + // currently - the space (descendant combinator), the greater-than + // bracket (child combinator), the plus sign (next sibling combinator), + // and the tilda (following sibling combinator). + // + // sequence of selectors: + // One or more of the named type of selector chained with commas. + + state.tokenize = state.tokenize || tokenBase; + if (state.tokenize == tokenBase && stream.eatSpace()) return null; + var style = state.tokenize(stream, state); + if (style && typeof style != "string") style = ret(style[0], style[1]); + + // Changing style returned based on context + var context = state.stack[state.stack.length-1]; + if (style == "variable") { + if (type == "variable-definition") state.stack.push("propertyValue"); + return "variable-2"; + } else if (style == "property") { + var word = stream.current().toLowerCase(); + if (context == "propertyValue") { + if (valueKeywords.hasOwnProperty(word)) { + style = "string-2"; + } else if (colorKeywords.hasOwnProperty(word)) { + style = "keyword"; + } else { + style = "variable-2"; + } + } else if (context == "rule") { + if (!propertyKeywords.hasOwnProperty(word)) { + style += " error"; + } + } else if (context == "block") { + // if a value is present in both property, value, or color, the order + // of preference is property -> color -> value + if (propertyKeywords.hasOwnProperty(word)) { + style = "property"; + } else if (colorKeywords.hasOwnProperty(word)) { + style = "keyword"; + } else if (valueKeywords.hasOwnProperty(word)) { + style = "string-2"; + } else { + style = "tag"; + } + } else if (!context || context == "@media{") { + style = "tag"; + } else if (context == "@media") { + if (atMediaTypes[stream.current()]) { + style = "attribute"; // Known attribute + } else if (/^(only|not)$/.test(word)) { + style = "keyword"; + } else if (word == "and") { + style = "error"; // "and" is only allowed in @mediaType + } else if (atMediaFeatures.hasOwnProperty(word)) { + style = "error"; // Known property, should be in @mediaType( + } else { + // Unknown, expecting keyword or attribute, assuming attribute + style = "attribute error"; + } + } else if (context == "@mediaType") { + if (atMediaTypes.hasOwnProperty(word)) { + style = "attribute"; + } else if (word == "and") { + style = "operator"; + } else if (/^(only|not)$/.test(word)) { + style = "error"; // Only allowed in @media + } else { + // Unknown attribute or property, but expecting property (preceded + // by "and"). Should be in parentheses + style = "error"; + } + } else if (context == "@mediaType(") { + if (propertyKeywords.hasOwnProperty(word)) { + // do nothing, remains "property" + } else if (atMediaTypes.hasOwnProperty(word)) { + style = "error"; // Known property, should be in parentheses + } else if (word == "and") { + style = "operator"; + } else if (/^(only|not)$/.test(word)) { + style = "error"; // Only allowed in @media + } else { + style += " error"; + } + } else if (context == "@import") { + style = "tag"; + } else { + style = "error"; + } + } else if (style == "atom") { + if(!context || context == "@media{" || context == "block") { + style = "builtin"; + } else if (context == "propertyValue") { + if (!/^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/.test(stream.current())) { + style += " error"; + } + } else { + style = "error"; + } + } else if (context == "@media" && type == "{") { + style = "error"; + } + + // Push/pop context stack + if (type == "{") { + if (context == "@media" || context == "@mediaType") { + state.stack.pop(); + state.stack[state.stack.length-1] = "@media{"; + } + else { + var newContext = allowNested ? "block" : "rule"; + state.stack.push(newContext); + } + } + else if (type == "}") { + var lastState = state.stack[state.stack.length - 1]; + if (lastState == "interpolation") style = "operator"; + state.stack.pop(); + if (context == "propertyValue") state.stack.pop(); + } + else if (type == "interpolation") state.stack.push("interpolation"); + else if (type == "@media") state.stack.push("@media"); + else if (type == "@import") state.stack.push("@import"); + else if (context == "@media" && /\b(keyword|attribute)\b/.test(style)) + state.stack.push("@mediaType"); + else if (context == "@mediaType" && stream.current() == ",") state.stack.pop(); + else if (context == "@mediaType" && type == "(") state.stack.push("@mediaType("); + else if (context == "@mediaType(" && type == ")") state.stack.pop(); + else if ((context == "rule" || context == "block") && type == ":") state.stack.push("propertyValue"); + else if (context == "propertyValue" && type == ";") state.stack.pop(); + else if (context == "@import" && type == ";") state.stack.pop(); + return style; + }, + + indent: function(state, textAfter) { + var n = state.stack.length; + if (/^\}/.test(textAfter)) + n -= state.stack[state.stack.length-1] == "propertyValue" ? 2 : 1; + return state.baseIndent + n * indentUnit; + }, + + electricChars: "}", + blockCommentStart: "/*", + blockCommentEnd: "*/" + }; +}); + +(function() { + function keySet(array) { + var keys = {}; + for (var i = 0; i < array.length; ++i) { + keys[array[i]] = true; + } + return keys; + } + + var atMediaTypes = keySet([ + "all", "aural", "braille", "handheld", "print", "projection", "screen", + "tty", "tv", "embossed" + ]); + + var atMediaFeatures = keySet([ + "width", "min-width", "max-width", "height", "min-height", "max-height", + "device-width", "min-device-width", "max-device-width", "device-height", + "min-device-height", "max-device-height", "aspect-ratio", + "min-aspect-ratio", "max-aspect-ratio", "device-aspect-ratio", + "min-device-aspect-ratio", "max-device-aspect-ratio", "color", "min-color", + "max-color", "color-index", "min-color-index", "max-color-index", + "monochrome", "min-monochrome", "max-monochrome", "resolution", + "min-resolution", "max-resolution", "scan", "grid" + ]); + + var propertyKeywords = keySet([ + "align-content", "align-items", "align-self", "alignment-adjust", + "alignment-baseline", "anchor-point", "animation", "animation-delay", + "animation-direction", "animation-duration", "animation-iteration-count", + "animation-name", "animation-play-state", "animation-timing-function", + "appearance", "azimuth", "backface-visibility", "background", + "background-attachment", "background-clip", "background-color", + "background-image", "background-origin", "background-position", + "background-repeat", "background-size", "baseline-shift", "binding", + "bleed", "bookmark-label", "bookmark-level", "bookmark-state", + "bookmark-target", "border", "border-bottom", "border-bottom-color", + "border-bottom-left-radius", "border-bottom-right-radius", + "border-bottom-style", "border-bottom-width", "border-collapse", + "border-color", "border-image", "border-image-outset", + "border-image-repeat", "border-image-slice", "border-image-source", + "border-image-width", "border-left", "border-left-color", + "border-left-style", "border-left-width", "border-radius", "border-right", + "border-right-color", "border-right-style", "border-right-width", + "border-spacing", "border-style", "border-top", "border-top-color", + "border-top-left-radius", "border-top-right-radius", "border-top-style", + "border-top-width", "border-width", "bottom", "box-decoration-break", + "box-shadow", "box-sizing", "break-after", "break-before", "break-inside", + "caption-side", "clear", "clip", "color", "color-profile", "column-count", + "column-fill", "column-gap", "column-rule", "column-rule-color", + "column-rule-style", "column-rule-width", "column-span", "column-width", + "columns", "content", "counter-increment", "counter-reset", "crop", "cue", + "cue-after", "cue-before", "cursor", "direction", "display", + "dominant-baseline", "drop-initial-after-adjust", + "drop-initial-after-align", "drop-initial-before-adjust", + "drop-initial-before-align", "drop-initial-size", "drop-initial-value", + "elevation", "empty-cells", "fit", "fit-position", "flex", "flex-basis", + "flex-direction", "flex-flow", "flex-grow", "flex-shrink", "flex-wrap", + "float", "float-offset", "font", "font-feature-settings", "font-family", + "font-kerning", "font-language-override", "font-size", "font-size-adjust", + "font-stretch", "font-style", "font-synthesis", "font-variant", + "font-variant-alternates", "font-variant-caps", "font-variant-east-asian", + "font-variant-ligatures", "font-variant-numeric", "font-variant-position", + "font-weight", "grid-cell", "grid-column", "grid-column-align", + "grid-column-sizing", "grid-column-span", "grid-columns", "grid-flow", + "grid-row", "grid-row-align", "grid-row-sizing", "grid-row-span", + "grid-rows", "grid-template", "hanging-punctuation", "height", "hyphens", + "icon", "image-orientation", "image-rendering", "image-resolution", + "inline-box-align", "justify-content", "left", "letter-spacing", + "line-break", "line-height", "line-stacking", "line-stacking-ruby", + "line-stacking-shift", "line-stacking-strategy", "list-style", + "list-style-image", "list-style-position", "list-style-type", "margin", + "margin-bottom", "margin-left", "margin-right", "margin-top", + "marker-offset", "marks", "marquee-direction", "marquee-loop", + "marquee-play-count", "marquee-speed", "marquee-style", "max-height", + "max-width", "min-height", "min-width", "move-to", "nav-down", "nav-index", + "nav-left", "nav-right", "nav-up", "opacity", "order", "orphans", "outline", + "outline-color", "outline-offset", "outline-style", "outline-width", + "overflow", "overflow-style", "overflow-wrap", "overflow-x", "overflow-y", + "padding", "padding-bottom", "padding-left", "padding-right", "padding-top", + "page", "page-break-after", "page-break-before", "page-break-inside", + "page-policy", "pause", "pause-after", "pause-before", "perspective", + "perspective-origin", "pitch", "pitch-range", "play-during", "position", + "presentation-level", "punctuation-trim", "quotes", "rendering-intent", + "resize", "rest", "rest-after", "rest-before", "richness", "right", + "rotation", "rotation-point", "ruby-align", "ruby-overhang", + "ruby-position", "ruby-span", "size", "speak", "speak-as", "speak-header", + "speak-numeral", "speak-punctuation", "speech-rate", "stress", "string-set", + "tab-size", "table-layout", "target", "target-name", "target-new", + "target-position", "text-align", "text-align-last", "text-decoration", + "text-decoration-color", "text-decoration-line", "text-decoration-skip", + "text-decoration-style", "text-emphasis", "text-emphasis-color", + "text-emphasis-position", "text-emphasis-style", "text-height", + "text-indent", "text-justify", "text-outline", "text-shadow", + "text-space-collapse", "text-transform", "text-underline-position", + "text-wrap", "top", "transform", "transform-origin", "transform-style", + "transition", "transition-delay", "transition-duration", + "transition-property", "transition-timing-function", "unicode-bidi", + "vertical-align", "visibility", "voice-balance", "voice-duration", + "voice-family", "voice-pitch", "voice-range", "voice-rate", "voice-stress", + "voice-volume", "volume", "white-space", "widows", "width", "word-break", + "word-spacing", "word-wrap", "z-index", + // SVG-specific + "clip-path", "clip-rule", "mask", "enable-background", "filter", "flood-color", + "flood-opacity", "lighting-color", "stop-color", "stop-opacity", "pointer-events", + "color-interpolation", "color-interpolation-filters", "color-profile", + "color-rendering", "fill", "fill-opacity", "fill-rule", "image-rendering", + "marker", "marker-end", "marker-mid", "marker-start", "shape-rendering", "stroke", + "stroke-dasharray", "stroke-dashoffset", "stroke-linecap", "stroke-linejoin", + "stroke-miterlimit", "stroke-opacity", "stroke-width", "text-rendering", + "baseline-shift", "dominant-baseline", "glyph-orientation-horizontal", + "glyph-orientation-vertical", "kerning", "text-anchor", "writing-mode" + ]); + + var colorKeywords = keySet([ + "aliceblue", "antiquewhite", "aqua", "aquamarine", "azure", "beige", + "bisque", "black", "blanchedalmond", "blue", "blueviolet", "brown", + "burlywood", "cadetblue", "chartreuse", "chocolate", "coral", "cornflowerblue", + "cornsilk", "crimson", "cyan", "darkblue", "darkcyan", "darkgoldenrod", + "darkgray", "darkgreen", "darkkhaki", "darkmagenta", "darkolivegreen", + "darkorange", "darkorchid", "darkred", "darksalmon", "darkseagreen", + "darkslateblue", "darkslategray", "darkturquoise", "darkviolet", + "deeppink", "deepskyblue", "dimgray", "dodgerblue", "firebrick", + "floralwhite", "forestgreen", "fuchsia", "gainsboro", "ghostwhite", + "gold", "goldenrod", "gray", "green", "greenyellow", "honeydew", + "hotpink", "indianred", "indigo", "ivory", "khaki", "lavender", + "lavenderblush", "lawngreen", "lemonchiffon", "lightblue", "lightcoral", + "lightcyan", "lightgoldenrodyellow", "lightgray", "lightgreen", "lightpink", + "lightsalmon", "lightseagreen", "lightskyblue", "lightslategray", + "lightsteelblue", "lightyellow", "lime", "limegreen", "linen", "magenta", + "maroon", "mediumaquamarine", "mediumblue", "mediumorchid", "mediumpurple", + "mediumseagreen", "mediumslateblue", "mediumspringgreen", "mediumturquoise", + "mediumvioletred", "midnightblue", "mintcream", "mistyrose", "moccasin", + "navajowhite", "navy", "oldlace", "olive", "olivedrab", "orange", "orangered", + "orchid", "palegoldenrod", "palegreen", "paleturquoise", "palevioletred", + "papayawhip", "peachpuff", "peru", "pink", "plum", "powderblue", + "purple", "red", "rosybrown", "royalblue", "saddlebrown", "salmon", + "sandybrown", "seagreen", "seashell", "sienna", "silver", "skyblue", + "slateblue", "slategray", "snow", "springgreen", "steelblue", "tan", + "teal", "thistle", "tomato", "turquoise", "violet", "wheat", "white", + "whitesmoke", "yellow", "yellowgreen" + ]); + + var valueKeywords = keySet([ + "above", "absolute", "activeborder", "activecaption", "afar", + "after-white-space", "ahead", "alias", "all", "all-scroll", "alternate", + "always", "amharic", "amharic-abegede", "antialiased", "appworkspace", + "arabic-indic", "armenian", "asterisks", "auto", "avoid", "background", + "backwards", "baseline", "below", "bidi-override", "binary", "bengali", + "blink", "block", "block-axis", "bold", "bolder", "border", "border-box", + "both", "bottom", "break-all", "break-word", "button", "button-bevel", + "buttonface", "buttonhighlight", "buttonshadow", "buttontext", "cambodian", + "capitalize", "caps-lock-indicator", "caption", "captiontext", "caret", + "cell", "center", "checkbox", "circle", "cjk-earthly-branch", + "cjk-heavenly-stem", "cjk-ideographic", "clear", "clip", "close-quote", + "col-resize", "collapse", "compact", "condensed", "contain", "content", + "content-box", "context-menu", "continuous", "copy", "cover", "crop", + "cross", "crosshair", "currentcolor", "cursive", "dashed", "decimal", + "decimal-leading-zero", "default", "default-button", "destination-atop", + "destination-in", "destination-out", "destination-over", "devanagari", + "disc", "discard", "document", "dot-dash", "dot-dot-dash", "dotted", + "double", "down", "e-resize", "ease", "ease-in", "ease-in-out", "ease-out", + "element", "ellipsis", "embed", "end", "ethiopic", "ethiopic-abegede", + "ethiopic-abegede-am-et", "ethiopic-abegede-gez", "ethiopic-abegede-ti-er", + "ethiopic-abegede-ti-et", "ethiopic-halehame-aa-er", + "ethiopic-halehame-aa-et", "ethiopic-halehame-am-et", + "ethiopic-halehame-gez", "ethiopic-halehame-om-et", + "ethiopic-halehame-sid-et", "ethiopic-halehame-so-et", + "ethiopic-halehame-ti-er", "ethiopic-halehame-ti-et", + "ethiopic-halehame-tig", "ew-resize", "expanded", "extra-condensed", + "extra-expanded", "fantasy", "fast", "fill", "fixed", "flat", "footnotes", + "forwards", "from", "geometricPrecision", "georgian", "graytext", "groove", + "gujarati", "gurmukhi", "hand", "hangul", "hangul-consonant", "hebrew", + "help", "hidden", "hide", "higher", "highlight", "highlighttext", + "hiragana", "hiragana-iroha", "horizontal", "hsl", "hsla", "icon", "ignore", + "inactiveborder", "inactivecaption", "inactivecaptiontext", "infinite", + "infobackground", "infotext", "inherit", "initial", "inline", "inline-axis", + "inline-block", "inline-table", "inset", "inside", "intrinsic", "invert", + "italic", "justify", "kannada", "katakana", "katakana-iroha", "khmer", + "landscape", "lao", "large", "larger", "left", "level", "lighter", + "line-through", "linear", "lines", "list-item", "listbox", "listitem", + "local", "logical", "loud", "lower", "lower-alpha", "lower-armenian", + "lower-greek", "lower-hexadecimal", "lower-latin", "lower-norwegian", + "lower-roman", "lowercase", "ltr", "malayalam", "match", + "media-controls-background", "media-current-time-display", + "media-fullscreen-button", "media-mute-button", "media-play-button", + "media-return-to-realtime-button", "media-rewind-button", + "media-seek-back-button", "media-seek-forward-button", "media-slider", + "media-sliderthumb", "media-time-remaining-display", "media-volume-slider", + "media-volume-slider-container", "media-volume-sliderthumb", "medium", + "menu", "menulist", "menulist-button", "menulist-text", + "menulist-textfield", "menutext", "message-box", "middle", "min-intrinsic", + "mix", "mongolian", "monospace", "move", "multiple", "myanmar", "n-resize", + "narrower", "ne-resize", "nesw-resize", "no-close-quote", "no-drop", + "no-open-quote", "no-repeat", "none", "normal", "not-allowed", "nowrap", + "ns-resize", "nw-resize", "nwse-resize", "oblique", "octal", "open-quote", + "optimizeLegibility", "optimizeSpeed", "oriya", "oromo", "outset", + "outside", "overlay", "overline", "padding", "padding-box", "painted", + "paused", "persian", "plus-darker", "plus-lighter", "pointer", "portrait", + "pre", "pre-line", "pre-wrap", "preserve-3d", "progress", "push-button", + "radio", "read-only", "read-write", "read-write-plaintext-only", "relative", + "repeat", "repeat-x", "repeat-y", "reset", "reverse", "rgb", "rgba", + "ridge", "right", "round", "row-resize", "rtl", "run-in", "running", + "s-resize", "sans-serif", "scroll", "scrollbar", "se-resize", "searchfield", + "searchfield-cancel-button", "searchfield-decoration", + "searchfield-results-button", "searchfield-results-decoration", + "semi-condensed", "semi-expanded", "separate", "serif", "show", "sidama", + "single", "skip-white-space", "slide", "slider-horizontal", + "slider-vertical", "sliderthumb-horizontal", "sliderthumb-vertical", "slow", + "small", "small-caps", "small-caption", "smaller", "solid", "somali", + "source-atop", "source-in", "source-out", "source-over", "space", "square", + "square-button", "start", "static", "status-bar", "stretch", "stroke", + "sub", "subpixel-antialiased", "super", "sw-resize", "table", + "table-caption", "table-cell", "table-column", "table-column-group", + "table-footer-group", "table-header-group", "table-row", "table-row-group", + "telugu", "text", "text-bottom", "text-top", "textarea", "textfield", "thai", + "thick", "thin", "threeddarkshadow", "threedface", "threedhighlight", + "threedlightshadow", "threedshadow", "tibetan", "tigre", "tigrinya-er", + "tigrinya-er-abegede", "tigrinya-et", "tigrinya-et-abegede", "to", "top", + "transparent", "ultra-condensed", "ultra-expanded", "underline", "up", + "upper-alpha", "upper-armenian", "upper-greek", "upper-hexadecimal", + "upper-latin", "upper-norwegian", "upper-roman", "uppercase", "urdu", "url", + "vertical", "vertical-text", "visible", "visibleFill", "visiblePainted", + "visibleStroke", "visual", "w-resize", "wait", "wave", "wider", + "window", "windowframe", "windowtext", "x-large", "x-small", "xor", + "xx-large", "xx-small" + ]); + + function tokenCComment(stream, state) { + var maybeEnd = false, ch; + while ((ch = stream.next()) != null) { + if (maybeEnd && ch == "/") { + state.tokenize = null; + break; + } + maybeEnd = (ch == "*"); + } + return ["comment", "comment"]; + } + + CodeMirror.defineMIME("text/css", { + atMediaTymixerp: atMediaTypes, + atMediaFeatures: atMediaFeatures, + propertyKeywords: propertyKeywords, + colorKeywords: colorKeywords, + valueKeywords: valueKeywords, + hooks: { + "<": function(stream, state) { + function tokenSGMLComment(stream, state) { + var dashes = 0, ch; + while ((ch = stream.next()) != null) { + if (dashes >= 2 && ch == ">") { + state.tokenize = null; + break; + } + dashes = (ch == "-") ? dashes + 1 : 0; + } + return ["comment", "comment"]; + } + if (stream.eat("!")) { + state.tokenize = tokenSGMLComment; + return tokenSGMLComment(stream, state); + } + }, + "/": function(stream, state) { + if (stream.eat("*")) { + state.tokenize = tokenCComment; + return tokenCComment(stream, state); + } + return false; + } + }, + name: "css-base" + }); + + CodeMirror.defineMIME("text/x-scss", { + atMediaTymixerp: atMediaTypes, + atMediaFeatures: atMediaFeatures, + propertyKeywords: propertyKeywords, + colorKeywords: colorKeywords, + valueKeywords: valueKeywords, + allowNested: true, + hooks: { + "$": function(stream) { + stream.match(/^[\w-]+/); + if (stream.peek() == ":") { + return ["variable", "variable-definition"]; + } + return ["variable", "variable"]; + }, + "/": function(stream, state) { + if (stream.eat("/")) { + stream.skipToEnd(); + return ["comment", "comment"]; + } else if (stream.eat("*")) { + state.tokenize = tokenCComment; + return tokenCComment(stream, state); + } else { + return ["operator", "operator"]; + } + }, + "#": function(stream) { + if (stream.eat("{")) { + return ["operator", "interpolation"]; + } else { + stream.eatWhile(/[\w\\\-]/); + return ["atom", "hash"]; + } + } + }, + name: "css-base" + }); +})(); diff --git a/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/css/index.html b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/css/index.html new file mode 100644 index 000000000..ae2c3bfce --- /dev/null +++ b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/css/index.html @@ -0,0 +1,58 @@ + + + + + CodeMirror: CSS mode + + + + + + + +

CodeMirror: CSS mode

+
+ + +

MIME types defined: text/css.

+ +

Parsing/Highlighting Tests: normal, verbose.

+ + + diff --git a/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/css/scss.html b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/css/scss.html new file mode 100644 index 000000000..b90cbe876 --- /dev/null +++ b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/css/scss.html @@ -0,0 +1,145 @@ + + + + + CodeMirror: SCSS mode + + + + + + + +

CodeMirror: SCSS mode

+
+ + +

MIME types defined: text/scss.

+ +

Parsing/Highlighting Tests: normal, verbose.

+ + + diff --git a/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/css/scss_test.js b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/css/scss_test.js new file mode 100644 index 000000000..996dc7884 --- /dev/null +++ b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/css/scss_test.js @@ -0,0 +1,80 @@ +(function() { + var mode = CodeMirror.getMode({tabSize: 4}, "text/x-scss"); + function MT(name) { test.mode(name, mode, Array.prototype.slice.call(arguments, 1), "scss"); } + + MT('url_with_quotation', + "[tag foo] { [property background][operator :][string-2 url]([string test.jpg]) }"); + + MT('url_with_double_quotes', + "[tag foo] { [property background][operator :][string-2 url]([string \"test.jpg\"]) }"); + + MT('url_with_single_quotes', + "[tag foo] { [property background][operator :][string-2 url]([string \'test.jpg\']) }"); + + MT('string', + "[def @import] [string \"compass/css3\"]"); + + MT('important_keyword', + "[tag foo] { [property background][operator :][string-2 url]([string \'test.jpg\']) [keyword !important] }"); + + MT('variable', + "[variable-2 $blue][operator :][atom #333]"); + + MT('variable_as_attribute', + "[tag foo] { [property color][operator :][variable-2 $blue] }"); + + MT('numbers', + "[tag foo] { [property padding][operator :][number 10px] [number 10] [number 10em] [number 8in] }"); + + MT('number_percentage', + "[tag foo] { [property width][operator :][number 80%] }"); + + MT('selector', + "[builtin #hello][qualifier .world]{}"); + + MT('singleline_comment', + "[comment // this is a comment]"); + + MT('multiline_comment', + "[comment /*foobar*/]"); + + MT('attribute_with_hyphen', + "[tag foo] { [property font-size][operator :][number 10px] }"); + + MT('string_after_attribute', + "[tag foo] { [property content][operator :][string \"::\"] }"); + + MT('directives', + "[def @include] [qualifier .mixin]"); + + MT('basic_structure', + "[tag p] { [property background][operator :][keyword red]; }"); + + MT('nested_structure', + "[tag p] { [tag a] { [property color][operator :][keyword red]; } }"); + + MT('mixin', + "[def @mixin] [tag table-base] {}"); + + MT('number_without_semicolon', + "[tag p] {[property width][operator :][number 12]}", + "[tag a] {[property color][operator :][keyword red];}"); + + MT('atom_in_nested_block', + "[tag p] { [tag a] { [property color][operator :][atom #000]; } }"); + + MT('interpolation_in_property', + "[tag foo] { [operator #{][variable-2 $hello][operator }:][atom #000]; }"); + + MT('interpolation_in_selector', + "[tag foo][operator #{][variable-2 $hello][operator }] { [property color][operator :][atom #000]; }"); + + MT('interpolation_error', + "[tag foo][operator #{][error foo][operator }] { [property color][operator :][atom #000]; }"); + + MT("divide_operator", + "[tag foo] { [property width][operator :][number 4] [operator /] [number 2] }"); + + MT('nested_structure_with_id_selector', + "[tag p] { [builtin #hello] { [property color][operator :][keyword red]; } }"); +})(); diff --git a/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/css/test.js b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/css/test.js new file mode 100644 index 000000000..97dd0a8a3 --- /dev/null +++ b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/css/test.js @@ -0,0 +1,113 @@ +(function() { + var mode = CodeMirror.getMode({tabSize: 4}, "css"); + function MT(name) { test.mode(name, mode, Array.prototype.slice.call(arguments, 1)); } + + // Requires at least one media query + MT("atMediaEmpty", + "[def @media] [error {] }"); + + MT("atMediaMultiple", + "[def @media] [keyword not] [attribute screen] [operator and] ([property color]), [keyword not] [attribute print] [operator and] ([property color]) { }"); + + MT("atMediaCheckStack", + "[def @media] [attribute screen] { } [tag foo] { }"); + + MT("atMediaCheckStack", + "[def @media] [attribute screen] ([property color]) { } [tag foo] { }"); + + MT("atMediaCheckStackInvalidAttribute", + "[def @media] [attribute&error foobarhello] { } [tag foo] { }"); + + // Error, because "and" is only allowed immediately preceding a media expression + MT("atMediaInvalidAttribute", + "[def @media] [attribute&error foobarhello] { }"); + + // Error, because "and" is only allowed immediately preceding a media expression + MT("atMediaInvalidAnd", + "[def @media] [error and] [attribute screen] { }"); + + // Error, because "not" is only allowed as the first item in each media query + MT("atMediaInvalidNot", + "[def @media] [attribute screen] [error not] ([error not]) { }"); + + // Error, because "only" is only allowed as the first item in each media query + MT("atMediaInvalidOnly", + "[def @media] [attribute screen] [error only] ([error only]) { }"); + + // Error, because "foobarhello" is neither a known type or property, but + // property was expected (after "and"), and it should be in parenthese. + MT("atMediaUnknownType", + "[def @media] [attribute screen] [operator and] [error foobarhello] { }"); + + // Error, because "color" is not a known type, but is a known property, and + // should be in parentheses. + MT("atMediaInvalidType", + "[def @media] [attribute screen] [operator and] [error color] { }"); + + // Error, because "print" is not a known property, but is a known type, + // and should not be in parenthese. + MT("atMediaInvalidProperty", + "[def @media] [attribute screen] [operator and] ([error print]) { }"); + + // Soft error, because "foobarhello" is not a known property or type. + MT("atMediaUnknownProperty", + "[def @media] [attribute screen] [operator and] ([property&error foobarhello]) { }"); + + MT("tagSelector", + "[tag foo] { }"); + + MT("classSelector", + "[qualifier .foo-bar_hello] { }"); + + MT("idSelector", + "[builtin #foo] { [error #foo] }"); + + MT("tagSelectorUnclosed", + "[tag foo] { [property margin][operator :] [number 0] } [tag bar] { }"); + + MT("tagStringNoQuotes", + "[tag foo] { [property font-family][operator :] [variable-2 hello] [variable-2 world]; }"); + + MT("tagStringDouble", + "[tag foo] { [property font-family][operator :] [string \"hello world\"]; }"); + + MT("tagStringSingle", + "[tag foo] { [property font-family][operator :] [string 'hello world']; }"); + + MT("tagColorKeyword", + "[tag foo] {" + + "[property color][operator :] [keyword black];" + + "[property color][operator :] [keyword navy];" + + "[property color][operator :] [keyword yellow];" + + "}"); + + MT("tagColorHex3", + "[tag foo] { [property background][operator :] [atom #fff]; }"); + + MT("tagColorHex6", + "[tag foo] { [property background][operator :] [atom #ffffff]; }"); + + MT("tagColorHex4", + "[tag foo] { [property background][operator :] [atom&error #ffff]; }"); + + MT("tagColorHexInvalid", + "[tag foo] { [property background][operator :] [atom&error #ffg]; }"); + + MT("tagNegativeNumber", + "[tag foo] { [property margin][operator :] [number -5px]; }"); + + MT("tagPositiveNumber", + "[tag foo] { [property padding][operator :] [number 5px]; }"); + + MT("tagVendor", + "[tag foo] { [meta -foo-][property box-sizing][operator :] [meta -foo-][string-2 border-box]; }"); + + MT("tagBogusProperty", + "[tag foo] { [property&error barhelloworld][operator :] [number 0]; }"); + + MT("tagTwoProperties", + "[tag foo] { [property margin][operator :] [number 0]; [property padding][operator :] [number 0]; }"); + + MT("commentSGML", + "[comment ]"); +})(); diff --git a/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/d/d.js b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/d/d.js new file mode 100644 index 000000000..ab345f1a0 --- /dev/null +++ b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/d/d.js @@ -0,0 +1,205 @@ +CodeMirror.defineMode("d", function(config, parserConfig) { + var indentUnit = config.indentUnit, + statementIndentUnit = parserConfig.statementIndentUnit || indentUnit, + 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 == "'" || 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 tokenNestedComment(stream, state); + } + 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 tokenNestedComment(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) return ctx.column + (closing ? 0 : 1); + else return ctx.indented + (closing ? 0 : indentUnit); + }, + + electricChars: "{}" + }; +}); + +(function() { + function words(str) { + var obj = {}, words = str.split(" "); + for (var i = 0; i < words.length; ++i) obj[words[i]] = true; + return obj; + } + + var blockKeywords = "body catch class do else enum for foreach foreach_reverse if in interface mixin " + + "out scope struct switch try union unittest version while with"; + + CodeMirror.defineMIME("text/x-d", { + name: "d", + keywords: words("abstract alias align asm assert auto break case cast cdouble cent cfloat const continue " + + "debug default delegate delete deprecated export extern final finally function goto immutable " + + "import inout invariant is lazy macro module new nothrow override package pragma private " + + "protected public pure ref return shared short static super synchronized template this " + + "throw typedef typeid typeof volatile __FILE__ __LINE__ __gshared __traits __vector __parameters " + + blockKeywords), + blockKeywords: words(blockKeywords), + builtin: words("bool byte char creal dchar double float idouble ifloat int ireal long real short ubyte " + + "ucent uint ulong ushort wchar wstring void size_t sizediff_t"), + atoms: words("exit failure success true false null"), + hooks: { + "@": function(stream, _state) { + stream.eatWhile(/[\w\$_]/); + return "meta"; + } + } + }); +}()); diff --git a/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/d/index.html b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/d/index.html new file mode 100644 index 000000000..13332727a --- /dev/null +++ b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/d/index.html @@ -0,0 +1,262 @@ + + + + + CodeMirror: D mode + + + + + + + + +

CodeMirror: D mode

+ +
+ + + +

Simple mode that handle D-Syntax (DLang Homepage).

+ +

MIME types defined: text/x-d + .

+ + diff --git a/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/diff/diff.js b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/diff/diff.js new file mode 100644 index 000000000..9a0d90ea5 --- /dev/null +++ b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/diff/diff.js @@ -0,0 +1,32 @@ +CodeMirror.defineMode("diff", function() { + + var TOKEN_NAMES = { + '+': 'positive', + '-': 'negative', + '@': 'meta' + }; + + return { + token: function(stream) { + var tw_pos = stream.string.search(/[\t ]+?$/); + + if (!stream.sol() || tw_pos === 0) { + stream.skipToEnd(); + return ("error " + ( + TOKEN_NAMES[stream.string.charAt(0)] || '')).replace(/ $/, ''); + } + + var token_name = TOKEN_NAMES[stream.peek()] || stream.skipToEnd(); + + if (tw_pos === -1) { + stream.skipToEnd(); + } else { + stream.pos = tw_pos; + } + + return token_name; + } + }; +}); + +CodeMirror.defineMIME("text/x-diff", "diff"); diff --git a/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/diff/index.html b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/diff/index.html new file mode 100644 index 000000000..556025204 --- /dev/null +++ b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/diff/index.html @@ -0,0 +1,105 @@ + + + + + CodeMirror: Diff mode + + + + + + + +

CodeMirror: Diff mode

+
+ + +

MIME types defined: text/x-diff.

+ + + diff --git a/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/ecl/ecl.js b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/ecl/ecl.js new file mode 100644 index 000000000..7601b189a --- /dev/null +++ b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/ecl/ecl.js @@ -0,0 +1,192 @@ +CodeMirror.defineMode("ecl", function(config) { + + function words(str) { + var obj = {}, words = str.split(" "); + for (var i = 0; i < words.length; ++i) obj[words[i]] = true; + return obj; + } + + function metaHook(stream, state) { + if (!state.startOfLine) return false; + stream.skipToEnd(); + return "meta"; + } + + var indentUnit = config.indentUnit; + var keyword = words("abs acos allnodes ascii asin asstring atan atan2 ave case choose choosen choosesets clustersize combine correlation cos cosh count covariance cron dataset dedup define denormalize distribute distributed distribution ebcdic enth error evaluate event eventextra eventname exists exp failcode failmessage fetch fromunicode getisvalid global graph group hash hash32 hash64 hashcrc hashmd5 having if index intformat isvalid iterate join keyunicode length library limit ln local log loop map matched matchlength matchposition matchtext matchunicode max merge mergejoin min nolocal nonempty normalize parse pipe power preload process project pull random range rank ranked realformat recordof regexfind regexreplace regroup rejected rollup round roundup row rowdiff sample set sin sinh sizeof soapcall sort sorted sqrt stepped stored sum table tan tanh thisnode topn tounicode transfer trim truncate typeof ungroup unicodeorder variance which workunit xmldecode xmlencode xmltext xmlunicode"); + var variable = words("apply assert build buildindex evaluate fail keydiff keypatch loadxml nothor notify output parallel sequential soapcall wait"); + var variable_2 = words("__compressed__ all and any as atmost before beginc++ best between case const counter csv descend encrypt end endc++ endmacro except exclusive expire export extend false few first flat from full function group header heading hole ifblock import in interface joined keep keyed last left limit load local locale lookup macro many maxcount maxlength min skew module named nocase noroot noscan nosort not of only opt or outer overwrite packed partition penalty physicallength pipe quote record relationship repeat return right scan self separator service shared skew skip sql store terminator thor threshold token transform trim true type unicodeorder unsorted validate virtual whole wild within xml xpath"); + var variable_3 = words("ascii big_endian boolean data decimal ebcdic integer pattern qstring real record rule set of string token udecimal unicode unsigned varstring varunicode"); + var builtin = words("checkpoint deprecated failcode failmessage failure global independent onwarning persist priority recovery stored success wait when"); + var blockKeywords = words("catch class do else finally for if switch try while"); + var atoms = words("true false null"); + var hooks = {"#": metaHook}; + var 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().toLowerCase(); + if (keyword.propertyIsEnumerable(cur)) { + if (blockKeywords.propertyIsEnumerable(cur)) curPunc = "newstatement"; + return "keyword"; + } else if (variable.propertyIsEnumerable(cur)) { + if (blockKeywords.propertyIsEnumerable(cur)) curPunc = "newstatement"; + return "variable"; + } else if (variable_2.propertyIsEnumerable(cur)) { + if (blockKeywords.propertyIsEnumerable(cur)) curPunc = "newstatement"; + return "variable-2"; + } else if (variable_3.propertyIsEnumerable(cur)) { + if (blockKeywords.propertyIsEnumerable(cur)) curPunc = "newstatement"; + return "variable-3"; + } else if (builtin.propertyIsEnumerable(cur)) { + if (blockKeywords.propertyIsEnumerable(cur)) curPunc = "newstatement"; + return "builtin"; + } else { //Data types are of from KEYWORD## + var i = cur.length - 1; + while(i >= 0 && (!isNaN(cur[i]) || cur[i] == '_')) + --i; + + if (i > 0) { + var cur2 = cur.substr(0, i + 1); + if (variable_3.propertyIsEnumerable(cur2)) { + if (blockKeywords.propertyIsEnumerable(cur2)) curPunc = "newstatement"; + return "variable-3"; + } + } + } + if (atoms.propertyIsEnumerable(cur)) return "atom"; + 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 || !(escaped || multiLineStrings)) + 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 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) { + return state.context = new Context(state.indented, 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 == ":") && 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" || (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 0; + 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 : indentUnit); + else if (ctx.align) return ctx.column + (closing ? 0 : 1); + else return ctx.indented + (closing ? 0 : indentUnit); + }, + + electricChars: "{}" + }; +}); + +CodeMirror.defineMIME("text/x-ecl", "ecl"); diff --git a/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/ecl/index.html b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/ecl/index.html new file mode 100644 index 000000000..0ba88c399 --- /dev/null +++ b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/ecl/index.html @@ -0,0 +1,39 @@ + + + + CodeMirror: ECL mode + + + + + + + +

CodeMirror: ECL mode

+
+ + +

Based on CodeMirror's clike mode. For more information see HPCC Systems web site.

+

MIME types defined: text/x-ecl.

+ + + diff --git a/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/erlang/erlang.js b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/erlang/erlang.js new file mode 100644 index 000000000..79e0434d1 --- /dev/null +++ b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/erlang/erlang.js @@ -0,0 +1,464 @@ +// block; "begin", "case", "fun", "if", "receive", "try": closed by "end" +// block internal; "after", "catch", "of" +// guard; "when", closed by "->" +// "->" opens a clause, closed by ";" or "." +// "<<" opens a binary, closed by ">>" +// "," appears in arglists, lists, tuples and terminates lines of code +// "." resets indentation to 0 +// obsolete; "cond", "let", "query" + +CodeMirror.defineMIME("text/x-erlang", "erlang"); + +CodeMirror.defineMode("erlang", function(cmCfg) { + + function rval(state,stream,type) { + // distinguish between "." as terminator and record field operator + if (type == "record") { + state.context = "record"; + }else{ + state.context = false; + } + + // remember last significant bit on last line for indenting + if (type != "whitespace" && type != "comment") { + state.lastToken = stream.current(); + } + // erlang -> CodeMirror tag + switch (type) { + case "atom": return "atom"; + case "attribute": return "attribute"; + case "builtin": return "builtin"; + case "comment": return "comment"; + case "fun": return "meta"; + case "function": return "tag"; + case "guard": return "property"; + case "keyword": return "keyword"; + case "macro": return "variable-2"; + case "number": return "number"; + case "operator": return "operator"; + case "record": return "bracket"; + case "string": return "string"; + case "type": return "def"; + case "variable": return "variable"; + case "error": return "error"; + case "separator": return null; + case "open_paren": return null; + case "close_paren": return null; + default: return null; + } + } + + var typeWords = [ + "-type", "-spec", "-export_type", "-opaque"]; + + var keywordWords = [ + "after","begin","catch","case","cond","end","fun","if", + "let","of","query","receive","try","when"]; + + var separatorWords = [ + "->",";",":",".",","]; + + var operatorWords = [ + "and","andalso","band","bnot","bor","bsl","bsr","bxor", + "div","not","or","orelse","rem","xor"]; + + var symbolWords = [ + "+","-","*","/",">",">=","<","=<","=:=","==","=/=","/=","||","<-"]; + + var openParenWords = [ + "<<","(","[","{"]; + + var closeParenWords = [ + "}","]",")",">>"]; + + var guardWords = [ + "is_atom","is_binary","is_bitstring","is_boolean","is_float", + "is_function","is_integer","is_list","is_number","is_pid", + "is_port","is_record","is_reference","is_tuple", + "atom","binary","bitstring","boolean","function","integer","list", + "number","pid","port","record","reference","tuple"]; + + var bifWords = [ + "abs","adler32","adler32_combine","alive","apply","atom_to_binary", + "atom_to_list","binary_to_atom","binary_to_existing_atom", + "binary_to_list","binary_to_term","bit_size","bitstring_to_list", + "byte_size","check_process_code","contact_binary","crc32", + "crc32_combine","date","decode_packet","delete_module", + "disconnect_node","element","erase","exit","float","float_to_list", + "garbage_collect","get","get_keys","group_leader","halt","hd", + "integer_to_list","internal_bif","iolist_size","iolist_to_binary", + "is_alive","is_atom","is_binary","is_bitstring","is_boolean", + "is_float","is_function","is_integer","is_list","is_number","is_pid", + "is_port","is_process_alive","is_record","is_reference","is_tuple", + "length","link","list_to_atom","list_to_binary","list_to_bitstring", + "list_to_existing_atom","list_to_float","list_to_integer", + "list_to_pid","list_to_tuple","load_module","make_ref","module_loaded", + "monitor_node","node","node_link","node_unlink","nodes","notalive", + "now","open_port","pid_to_list","port_close","port_command", + "port_connect","port_control","pre_loaded","process_flag", + "process_info","processes","purge_module","put","register", + "registered","round","self","setelement","size","spawn","spawn_link", + "spawn_monitor","spawn_opt","split_binary","statistics", + "term_to_binary","time","throw","tl","trunc","tuple_size", + "tuple_to_list","unlink","unregister","whereis"]; + + // ignored for indenting purposes + var ignoreWords = [ + ",", ":", "catch", "after", "of", "cond", "let", "query"]; + + + var smallRE = /[a-z_]/; + var largeRE = /[A-Z_]/; + var digitRE = /[0-9]/; + var octitRE = /[0-7]/; + var anumRE = /[a-z_A-Z0-9]/; + var symbolRE = /[\+\-\*\/<>=\|:]/; + var openParenRE = /[<\(\[\{]/; + var closeParenRE = /[>\)\]\}]/; + var sepRE = /[\->\.,:;]/; + + function isMember(element,list) { + return (-1 < list.indexOf(element)); + } + + function isPrev(stream,string) { + var start = stream.start; + var len = string.length; + if (len <= start) { + var word = stream.string.slice(start-len,start); + return word == string; + }else{ + return false; + } + } + + function tokenize(stream, state) { + if (stream.eatSpace()) { + return rval(state,stream,"whitespace"); + } + + // attributes and type specs + if ((peekToken(state).token == "" || peekToken(state).token == ".") && + stream.peek() == '-') { + stream.next(); + if (stream.eat(smallRE) && stream.eatWhile(anumRE)) { + if (isMember(stream.current(),typeWords)) { + return rval(state,stream,"type"); + }else{ + return rval(state,stream,"attribute"); + } + } + stream.backUp(1); + } + + var ch = stream.next(); + + // comment + if (ch == '%') { + stream.skipToEnd(); + return rval(state,stream,"comment"); + } + + // macro + if (ch == '?') { + stream.eatWhile(anumRE); + return rval(state,stream,"macro"); + } + + // record + if ( ch == "#") { + stream.eatWhile(anumRE); + return rval(state,stream,"record"); + } + + // char + if ( ch == "$") { + if (stream.next() == "\\") { + if (!stream.eatWhile(octitRE)) { + stream.next(); + } + } + return rval(state,stream,"string"); + } + + // quoted atom + if (ch == '\'') { + if (singleQuote(stream)) { + return rval(state,stream,"atom"); + }else{ + return rval(state,stream,"error"); + } + } + + // string + if (ch == '"') { + if (doubleQuote(stream)) { + return rval(state,stream,"string"); + }else{ + return rval(state,stream,"error"); + } + } + + // variable + if (largeRE.test(ch)) { + stream.eatWhile(anumRE); + return rval(state,stream,"variable"); + } + + // atom/keyword/BIF/function + if (smallRE.test(ch)) { + stream.eatWhile(anumRE); + + if (stream.peek() == "/") { + stream.next(); + if (stream.eatWhile(digitRE)) { + return rval(state,stream,"fun"); // f/0 style fun + }else{ + stream.backUp(1); + return rval(state,stream,"atom"); + } + } + + var w = stream.current(); + + if (isMember(w,keywordWords)) { + pushToken(state,stream); + return rval(state,stream,"keyword"); + } + if (stream.peek() == "(") { + // 'put' and 'erlang:put' are bifs, 'foo:put' is not + if (isMember(w,bifWords) && + (!isPrev(stream,":") || isPrev(stream,"erlang:"))) { + return rval(state,stream,"builtin"); + }else{ + return rval(state,stream,"function"); + } + } + if (isMember(w,guardWords)) { + return rval(state,stream,"guard"); + } + if (isMember(w,operatorWords)) { + return rval(state,stream,"operator"); + } + if (stream.peek() == ":") { + if (w == "erlang") { + return rval(state,stream,"builtin"); + } else { + return rval(state,stream,"function"); + } + } + return rval(state,stream,"atom"); + } + + // number + if (digitRE.test(ch)) { + stream.eatWhile(digitRE); + if (stream.eat('#')) { + stream.eatWhile(digitRE); // 16#10 style integer + } else { + if (stream.eat('.')) { // float + stream.eatWhile(digitRE); + } + if (stream.eat(/[eE]/)) { + stream.eat(/[-+]/); // float with exponent + stream.eatWhile(digitRE); + } + } + return rval(state,stream,"number"); // normal integer + } + + // open parens + if (nongreedy(stream,openParenRE,openParenWords)) { + pushToken(state,stream); + return rval(state,stream,"open_paren"); + } + + // close parens + if (nongreedy(stream,closeParenRE,closeParenWords)) { + pushToken(state,stream); + return rval(state,stream,"close_paren"); + } + + // separators + if (greedy(stream,sepRE,separatorWords)) { + // distinguish between "." as terminator and record field operator + if (state.context == false) { + pushToken(state,stream); + } + return rval(state,stream,"separator"); + } + + // operators + if (greedy(stream,symbolRE,symbolWords)) { + return rval(state,stream,"operator"); + } + + return rval(state,stream,null); + } + + function nongreedy(stream,re,words) { + if (stream.current().length == 1 && re.test(stream.current())) { + stream.backUp(1); + while (re.test(stream.peek())) { + stream.next(); + if (isMember(stream.current(),words)) { + return true; + } + } + stream.backUp(stream.current().length-1); + } + return false; + } + + function greedy(stream,re,words) { + if (stream.current().length == 1 && re.test(stream.current())) { + while (re.test(stream.peek())) { + stream.next(); + } + while (0 < stream.current().length) { + if (isMember(stream.current(),words)) { + return true; + }else{ + stream.backUp(1); + } + } + stream.next(); + } + return false; + } + + function doubleQuote(stream) { + return quote(stream, '"', '\\'); + } + + function singleQuote(stream) { + return quote(stream,'\'','\\'); + } + + function quote(stream,quoteChar,escapeChar) { + while (!stream.eol()) { + var ch = stream.next(); + if (ch == quoteChar) { + return true; + }else if (ch == escapeChar) { + stream.next(); + } + } + return false; + } + + function Token(stream) { + this.token = stream ? stream.current() : ""; + this.column = stream ? stream.column() : 0; + this.indent = stream ? stream.indentation() : 0; + } + + function myIndent(state,textAfter) { + var indent = cmCfg.indentUnit; + var outdentWords = ["after","catch"]; + var token = (peekToken(state)).token; + var wordAfter = takewhile(textAfter,/[^a-z]/); + + if (isMember(token,openParenWords)) { + return (peekToken(state)).column+token.length; + }else if (token == "." || token == ""){ + return 0; + }else if (token == "->") { + if (wordAfter == "end") { + return peekToken(state,2).column; + }else if (peekToken(state,2).token == "fun") { + return peekToken(state,2).column+indent; + }else{ + return (peekToken(state)).indent+indent; + } + }else if (isMember(wordAfter,outdentWords)) { + return (peekToken(state)).indent; + }else{ + return (peekToken(state)).column+indent; + } + } + + function takewhile(str,re) { + var m = str.match(re); + return m ? str.slice(0,m.index) : str; + } + + function popToken(state) { + return state.tokenStack.pop(); + } + + function peekToken(state,depth) { + var len = state.tokenStack.length; + var dep = (depth ? depth : 1); + if (len < dep) { + return new Token; + }else{ + return state.tokenStack[len-dep]; + } + } + + function pushToken(state,stream) { + var token = stream.current(); + var prev_token = peekToken(state).token; + if (isMember(token,ignoreWords)) { + return false; + }else if (drop_both(prev_token,token)) { + popToken(state); + return false; + }else if (drop_first(prev_token,token)) { + popToken(state); + return pushToken(state,stream); + }else{ + state.tokenStack.push(new Token(stream)); + return true; + } + } + + function drop_first(open, close) { + switch (open+" "+close) { + case "when ->": return true; + case "-> end": return true; + case "-> .": return true; + case ". .": return true; + default: return false; + } + } + + function drop_both(open, close) { + switch (open+" "+close) { + case "( )": return true; + case "[ ]": return true; + case "{ }": return true; + case "<< >>": return true; + case "begin end": return true; + case "case end": return true; + case "fun end": return true; + case "if end": return true; + case "receive end": return true; + case "try end": return true; + case "-> ;": return true; + default: return false; + } + } + + return { + startState: + function() { + return {tokenStack: [], + context: false, + lastToken: null}; + }, + + token: + function(stream, state) { + return tokenize(stream, state); + }, + + indent: + function(state, textAfter) { + return myIndent(state,textAfter); + }, + + lineComment: "%" + }; +}); diff --git a/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/erlang/index.html b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/erlang/index.html new file mode 100644 index 000000000..fd21521c8 --- /dev/null +++ b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/erlang/index.html @@ -0,0 +1,64 @@ + + + + + CodeMirror: Erlang mode + + + + + + + + + +

CodeMirror: Erlang mode

+ +
+ + + +

MIME types defined: text/x-erlang.

+ + diff --git a/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/gas/gas.js b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/gas/gas.js new file mode 100644 index 000000000..a6e689290 --- /dev/null +++ b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/gas/gas.js @@ -0,0 +1,330 @@ +CodeMirror.defineMode("gas", function(_config, parserConfig) { + 'use strict'; + + // If an architecture is specified, its initialization function may + // populate this array with custom parsing functions which will be + // tried in the event that the standard functions do not find a match. + var custom = []; + + // The symbol used to start a line comment changes based on the target + // architecture. + // If no architecture is pased in "parserConfig" then only multiline + // comments will have syntax support. + var lineCommentStartSymbol = ""; + + // These directives are architecture independent. + // Machine specific directives should go in their respective + // architecture initialization function. + // Reference: + // http://sourceware.org/binutils/docs/as/Pseudo-Ops.html#Pseudo-Ops + var directives = { + ".abort" : "builtin", + ".align" : "builtin", + ".altmacro" : "builtin", + ".ascii" : "builtin", + ".asciz" : "builtin", + ".balign" : "builtin", + ".balignw" : "builtin", + ".balignl" : "builtin", + ".bundle_align_mode" : "builtin", + ".bundle_lock" : "builtin", + ".bundle_unlock" : "builtin", + ".byte" : "builtin", + ".cfi_startproc" : "builtin", + ".comm" : "builtin", + ".data" : "builtin", + ".def" : "builtin", + ".desc" : "builtin", + ".dim" : "builtin", + ".double" : "builtin", + ".eject" : "builtin", + ".else" : "builtin", + ".elseif" : "builtin", + ".end" : "builtin", + ".endef" : "builtin", + ".endfunc" : "builtin", + ".endif" : "builtin", + ".equ" : "builtin", + ".equiv" : "builtin", + ".eqv" : "builtin", + ".err" : "builtin", + ".error" : "builtin", + ".exitm" : "builtin", + ".extern" : "builtin", + ".fail" : "builtin", + ".file" : "builtin", + ".fill" : "builtin", + ".float" : "builtin", + ".func" : "builtin", + ".global" : "builtin", + ".gnu_attribute" : "builtin", + ".hidden" : "builtin", + ".hword" : "builtin", + ".ident" : "builtin", + ".if" : "builtin", + ".incbin" : "builtin", + ".include" : "builtin", + ".int" : "builtin", + ".internal" : "builtin", + ".irp" : "builtin", + ".irpc" : "builtin", + ".lcomm" : "builtin", + ".lflags" : "builtin", + ".line" : "builtin", + ".linkonce" : "builtin", + ".list" : "builtin", + ".ln" : "builtin", + ".loc" : "builtin", + ".loc_mark_labels" : "builtin", + ".local" : "builtin", + ".long" : "builtin", + ".macro" : "builtin", + ".mri" : "builtin", + ".noaltmacro" : "builtin", + ".nolist" : "builtin", + ".octa" : "builtin", + ".offset" : "builtin", + ".org" : "builtin", + ".p2align" : "builtin", + ".popsection" : "builtin", + ".previous" : "builtin", + ".print" : "builtin", + ".protected" : "builtin", + ".psize" : "builtin", + ".purgem" : "builtin", + ".pushsection" : "builtin", + ".quad" : "builtin", + ".reloc" : "builtin", + ".rept" : "builtin", + ".sbttl" : "builtin", + ".scl" : "builtin", + ".section" : "builtin", + ".set" : "builtin", + ".short" : "builtin", + ".single" : "builtin", + ".size" : "builtin", + ".skip" : "builtin", + ".sleb128" : "builtin", + ".space" : "builtin", + ".stab" : "builtin", + ".string" : "builtin", + ".struct" : "builtin", + ".subsection" : "builtin", + ".symver" : "builtin", + ".tag" : "builtin", + ".text" : "builtin", + ".title" : "builtin", + ".type" : "builtin", + ".uleb128" : "builtin", + ".val" : "builtin", + ".version" : "builtin", + ".vtable_entry" : "builtin", + ".vtable_inherit" : "builtin", + ".warning" : "builtin", + ".weak" : "builtin", + ".weakref" : "builtin", + ".word" : "builtin" + }; + + var registers = {}; + + function x86(_parserConfig) { + lineCommentStartSymbol = "#"; + + registers.ax = "variable"; + registers.eax = "variable-2"; + registers.rax = "variable-3"; + + registers.bx = "variable"; + registers.ebx = "variable-2"; + registers.rbx = "variable-3"; + + registers.cx = "variable"; + registers.ecx = "variable-2"; + registers.rcx = "variable-3"; + + registers.dx = "variable"; + registers.edx = "variable-2"; + registers.rdx = "variable-3"; + + registers.si = "variable"; + registers.esi = "variable-2"; + registers.rsi = "variable-3"; + + registers.di = "variable"; + registers.edi = "variable-2"; + registers.rdi = "variable-3"; + + registers.sp = "variable"; + registers.esp = "variable-2"; + registers.rsp = "variable-3"; + + registers.bp = "variable"; + registers.ebp = "variable-2"; + registers.rbp = "variable-3"; + + registers.ip = "variable"; + registers.eip = "variable-2"; + registers.rip = "variable-3"; + + registers.cs = "keyword"; + registers.ds = "keyword"; + registers.ss = "keyword"; + registers.es = "keyword"; + registers.fs = "keyword"; + registers.gs = "keyword"; + } + + function armv6(_parserConfig) { + // Reference: + // http://infocenter.arm.com/help/topic/com.arm.doc.qrc0001l/QRC0001_UAL.pdf + // http://infocenter.arm.com/help/topic/com.arm.doc.ddi0301h/DDI0301H_arm1176jzfs_r0p7_trm.pdf + lineCommentStartSymbol = "@"; + directives.syntax = "builtin"; + + registers.r0 = "variable"; + registers.r1 = "variable"; + registers.r2 = "variable"; + registers.r3 = "variable"; + registers.r4 = "variable"; + registers.r5 = "variable"; + registers.r6 = "variable"; + registers.r7 = "variable"; + registers.r8 = "variable"; + registers.r9 = "variable"; + registers.r10 = "variable"; + registers.r11 = "variable"; + registers.r12 = "variable"; + + registers.sp = "variable-2"; + registers.lr = "variable-2"; + registers.pc = "variable-2"; + registers.r13 = registers.sp; + registers.r14 = registers.lr; + registers.r15 = registers.pc; + + custom.push(function(ch, stream) { + if (ch === '#') { + stream.eatWhile(/\w/); + return "number"; + } + }); + } + + var arch = parserConfig.architecture.toLowerCase(); + if (arch === "x86") { + x86(parserConfig); + } else if (arch === "arm" || arch === "armv6") { + armv6(parserConfig); + } + + function nextUntilUnescaped(stream, end) { + var escaped = false, next; + while ((next = stream.next()) != null) { + if (next === end && !escaped) { + return false; + } + escaped = !escaped && next === "\\"; + } + return escaped; + } + + function clikeComment(stream, state) { + var maybeEnd = false, ch; + while ((ch = stream.next()) != null) { + if (ch === "/" && maybeEnd) { + state.tokenize = null; + break; + } + maybeEnd = (ch === "*"); + } + return "comment"; + } + + return { + startState: function() { + return { + tokenize: null + }; + }, + + token: function(stream, state) { + if (state.tokenize) { + return state.tokenize(stream, state); + } + + if (stream.eatSpace()) { + return null; + } + + var style, cur, ch = stream.next(); + + if (ch === "/") { + if (stream.eat("*")) { + state.tokenize = clikeComment; + return clikeComment(stream, state); + } + } + + if (ch === lineCommentStartSymbol) { + stream.skipToEnd(); + return "comment"; + } + + if (ch === '"') { + nextUntilUnescaped(stream, '"'); + return "string"; + } + + if (ch === '.') { + stream.eatWhile(/\w/); + cur = stream.current().toLowerCase(); + style = directives[cur]; + return style || null; + } + + if (ch === '=') { + stream.eatWhile(/\w/); + return "tag"; + } + + if (ch === '{') { + return "braket"; + } + + if (ch === '}') { + return "braket"; + } + + if (/\d/.test(ch)) { + if (ch === "0" && stream.eat("x")) { + stream.eatWhile(/[0-9a-fA-F]/); + return "number"; + } + stream.eatWhile(/\d/); + return "number"; + } + + if (/\w/.test(ch)) { + stream.eatWhile(/\w/); + if (stream.eat(":")) { + return 'tag'; + } + cur = stream.current().toLowerCase(); + style = registers[cur]; + return style || null; + } + + for (var i = 0; i < custom.length; i++) { + style = custom[i](ch, stream, state); + if (style) { + return style; + } + } + }, + + lineComment: lineCommentStartSymbol, + blockCommentStart: "/*", + blockCommentEnd: "*/" + }; +}); diff --git a/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/gas/index.html b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/gas/index.html new file mode 100644 index 000000000..7684bc18d --- /dev/null +++ b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/gas/index.html @@ -0,0 +1,57 @@ + + + + + CodeMirror: Gas mode + + + + + + + +

CodeMirror: Gas mode

+ +
+ +
+ + + +

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.

+ +

Parsing/Highlighting Tests: normal, verbose.

+ + + diff --git a/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/gfm/test.js b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/gfm/test.js new file mode 100644 index 000000000..3ccaec501 --- /dev/null +++ b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/gfm/test.js @@ -0,0 +1,112 @@ +(function() { + var mode = CodeMirror.getMode({tabSize: 4}, "gfm"); + function MT(name) { test.mode(name, mode, Array.prototype.slice.call(arguments, 1)); } + + MT("emInWordAsterisk", + "foo[em *bar*]hello"); + + MT("emInWordUnderscore", + "foo_bar_hello"); + + MT("emStrongUnderscore", + "[strong __][em&strong _foo__][em _] bar"); + + MT("fencedCodeBlocks", + "[comment ```]", + "[comment foo]", + "", + "[comment ```]", + "bar"); + + MT("fencedCodeBlockModeSwitching", + "[comment ```javascript]", + "[variable foo]", + "", + "[comment ```]", + "bar"); + + MT("taskListAsterisk", + "[variable-2 * []] foo]", // Invalid; must have space or x between [] + "[variable-2 * [ ]]bar]", // Invalid; must have space after ] + "[variable-2 * [x]]hello]", // Invalid; must have space after ] + "[variable-2 * ][meta [ ]]][variable-2 [world]]]", // Valid; tests reference style links + " [variable-3 * ][property [x]]][variable-3 foo]"); // Valid; can be nested + + MT("taskListPlus", + "[variable-2 + []] foo]", // Invalid; must have space or x between [] + "[variable-2 + [ ]]bar]", // Invalid; must have space after ] + "[variable-2 + [x]]hello]", // Invalid; must have space after ] + "[variable-2 + ][meta [ ]]][variable-2 [world]]]", // Valid; tests reference style links + " [variable-3 + ][property [x]]][variable-3 foo]"); // Valid; can be nested + + MT("taskListDash", + "[variable-2 - []] foo]", // Invalid; must have space or x between [] + "[variable-2 - [ ]]bar]", // Invalid; must have space after ] + "[variable-2 - [x]]hello]", // Invalid; must have space after ] + "[variable-2 - ][meta [ ]]][variable-2 [world]]]", // Valid; tests reference style links + " [variable-3 - ][property [x]]][variable-3 foo]"); // Valid; can be nested + + MT("taskListNumber", + "[variable-2 1. []] foo]", // Invalid; must have space or x between [] + "[variable-2 2. [ ]]bar]", // Invalid; must have space after ] + "[variable-2 3. [x]]hello]", // Invalid; must have space after ] + "[variable-2 4. ][meta [ ]]][variable-2 [world]]]", // Valid; tests reference style links + " [variable-3 1. ][property [x]]][variable-3 foo]"); // Valid; can be nested + + MT("SHA", + "foo [link be6a8cc1c1ecfe9489fb51e4869af15a13fc2cd2] bar"); + + MT("shortSHA", + "foo [link be6a8cc] bar"); + + MT("tooShortSHA", + "foo be6a8c bar"); + + MT("longSHA", + "foo be6a8cc1c1ecfe9489fb51e4869af15a13fc2cd22 bar"); + + MT("badSHA", + "foo be6a8cc1c1ecfe9489fb51e4869af15a13fc2cg2 bar"); + + MT("userSHA", + "foo [link bar@be6a8cc1c1ecfe9489fb51e4869af15a13fc2cd2] hello"); + + MT("userProjectSHA", + "foo [link bar/hello@be6a8cc1c1ecfe9489fb51e4869af15a13fc2cd2] world"); + + MT("num", + "foo [link #1] bar"); + + MT("badNum", + "foo #1bar hello"); + + MT("userNum", + "foo [link bar#1] hello"); + + MT("userProjectNum", + "foo [link bar/hello#1] world"); + + MT("vanillaLink", + "foo [link http://www.example.com/] bar"); + + MT("vanillaLinkPunctuation", + "foo [link http://www.example.com/]. bar"); + + MT("vanillaLinkExtension", + "foo [link http://www.example.com/index.html] bar"); + + MT("notALink", + "[comment ```css]", + "[tag foo] {[property color][operator :][keyword black];}", + "[comment ```][link http://www.example.com/]"); + + MT("notALink", + "[comment ``foo `bar` http://www.example.com/``] hello"); + + MT("notALink", + "[comment `foo]", + "[link http://www.example.com/]", + "[comment `foo]", + "", + "[link http://www.example.com/]"); +})(); diff --git a/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/go/go.js b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/go/go.js new file mode 100644 index 000000000..6a458a6fe --- /dev/null +++ b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/go/go.js @@ -0,0 +1,168 @@ +CodeMirror.defineMode("go", function(config) { + var indentUnit = config.indentUnit; + + var keywords = { + "break":true, "case":true, "chan":true, "const":true, "continue":true, + "default":true, "defer":true, "else":true, "fallthrough":true, "for":true, + "func":true, "go":true, "goto":true, "if":true, "import":true, + "interface":true, "map":true, "package":true, "range":true, "return":true, + "select":true, "struct":true, "switch":true, "type":true, "var":true, + "bool":true, "byte":true, "complex64":true, "complex128":true, + "float32":true, "float64":true, "int8":true, "int16":true, "int32":true, + "int64":true, "string":true, "uint8":true, "uint16":true, "uint32":true, + "uint64":true, "int":true, "uint":true, "uintptr":true + }; + + var atoms = { + "true":true, "false":true, "iota":true, "nil":true, "append":true, + "cap":true, "close":true, "complex":true, "copy":true, "imag":true, + "len":true, "make":true, "new":true, "panic":true, "print":true, + "println":true, "real":true, "recover":true + }; + + var isOperatorChar = /[+\-*&^%:=<>!|\/]/; + + var curPunc; + + function tokenBase(stream, state) { + var ch = stream.next(); + if (ch == '"' || ch == "'" || ch == "`") { + state.tokenize = tokenString(ch); + return state.tokenize(stream, state); + } + if (/[\d\.]/.test(ch)) { + if (ch == ".") { + stream.match(/^[0-9]+([eE][\-+]?[0-9]+)?/); + } else if (ch == "0") { + stream.match(/^[xX][0-9a-fA-F]+/) || stream.match(/^0[0-7]+/); + } else { + stream.match(/^[0-9]*\.?[0-9]*([eE][\-+]?[0-9]+)?/); + } + return "number"; + } + if (/[\[\]{}\(\),;\:\.]/.test(ch)) { + curPunc = ch; + return null; + } + 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 (cur == "case" || cur == "default") curPunc = "case"; + 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 || quote == "`")) + 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 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) { + return state.context = new Context(state.indented, 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 (ctx.type == "case") ctx.type = "}"; + } + if (stream.eatSpace()) return null; + curPunc = null; + var style = (state.tokenize || tokenBase)(stream, state); + if (style == "comment") return style; + if (ctx.align == null) ctx.align = true; + + if (curPunc == "{") pushContext(state, stream.column(), "}"); + else if (curPunc == "[") pushContext(state, stream.column(), "]"); + else if (curPunc == "(") pushContext(state, stream.column(), ")"); + else if (curPunc == "case") ctx.type = "case"; + else if (curPunc == "}" && ctx.type == "}") ctx = popContext(state); + else if (curPunc == ctx.type) popContext(state); + state.startOfLine = false; + return style; + }, + + indent: function(state, textAfter) { + if (state.tokenize != tokenBase && state.tokenize != null) return 0; + var ctx = state.context, firstChar = textAfter && textAfter.charAt(0); + if (ctx.type == "case" && /^(?:case|default)\b/.test(textAfter)) { + state.context.type = "}"; + return ctx.indented; + } + var closing = firstChar == ctx.type; + if (ctx.align) return ctx.column + (closing ? 0 : 1); + else return ctx.indented + (closing ? 0 : indentUnit); + }, + + electricChars: "{}:", + blockCommentStart: "/*", + blockCommentEnd: "*/", + lineComment: "//" + }; +}); + +CodeMirror.defineMIME("text/x-go", "go"); diff --git a/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/go/index.html b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/go/index.html new file mode 100644 index 000000000..8a6aafca2 --- /dev/null +++ b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/go/index.html @@ -0,0 +1,74 @@ + + + + + CodeMirror: Go mode + + + + + + + + + +

CodeMirror: Go mode

+ +
+ + + +

MIME type: text/x-go

+ + diff --git a/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/groovy/groovy.js b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/groovy/groovy.js new file mode 100644 index 000000000..92b948192 --- /dev/null +++ b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/groovy/groovy.js @@ -0,0 +1,210 @@ +CodeMirror.defineMode("groovy", function(config) { + 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( + "abstract as assert boolean break byte case catch char class const continue def default " + + "do double else enum extends final finally float for goto if implements import in " + + "instanceof int interface long native new package private protected public return " + + "short static strictfp super switch synchronized threadsafe throw throws transient " + + "try void volatile while"); + var blockKeywords = words("catch class do else finally for if switch try while enum interface def"); + var atoms = words("null true false this"); + + var curPunc; + function tokenBase(stream, state) { + var ch = stream.next(); + if (ch == '"' || ch == "'") { + return startString(ch, stream, state); + } + if (/[\[\]{}\(\),;\:\.]/.test(ch)) { + curPunc = ch; + return null; + } + if (/\d/.test(ch)) { + stream.eatWhile(/[\w\.]/); + if (stream.eat(/eE/)) { stream.eat(/\+\-/); stream.eatWhile(/\d/); } + return "number"; + } + if (ch == "/") { + if (stream.eat("*")) { + state.tokenize.push(tokenComment); + return tokenComment(stream, state); + } + if (stream.eat("/")) { + stream.skipToEnd(); + return "comment"; + } + if (expectExpression(state.lastToken)) { + return startString(ch, stream, state); + } + } + if (ch == "-" && stream.eat(">")) { + curPunc = "->"; + return null; + } + if (/[+\-*&%=<>!?|\/~]/.test(ch)) { + stream.eatWhile(/[+\-*&%=<>|~]/); + return "operator"; + } + stream.eatWhile(/[\w\$_]/); + if (ch == "@") { stream.eatWhile(/[\w\$_\.]/); return "meta"; } + if (state.lastToken == ".") return "property"; + if (stream.eat(":")) { curPunc = "proplabel"; return "property"; } + var cur = stream.current(); + if (atoms.propertyIsEnumerable(cur)) { return "atom"; } + if (keywords.propertyIsEnumerable(cur)) { + if (blockKeywords.propertyIsEnumerable(cur)) curPunc = "newstatement"; + return "keyword"; + } + return "variable"; + } + tokenBase.isBase = true; + + function startString(quote, stream, state) { + var tripleQuoted = false; + if (quote != "/" && stream.eat(quote)) { + if (stream.eat(quote)) tripleQuoted = true; + else return "string"; + } + function t(stream, state) { + var escaped = false, next, end = !tripleQuoted; + while ((next = stream.next()) != null) { + if (next == quote && !escaped) { + if (!tripleQuoted) { break; } + if (stream.match(quote + quote)) { end = true; break; } + } + if (quote == '"' && next == "$" && !escaped && stream.eat("{")) { + state.tokenize.push(tokenBaseUntilBrace()); + return "string"; + } + escaped = !escaped && next == "\\"; + } + if (end) state.tokenize.pop(); + return "string"; + } + state.tokenize.push(t); + return t(stream, state); + } + + function tokenBaseUntilBrace() { + var depth = 1; + function t(stream, state) { + if (stream.peek() == "}") { + depth--; + if (depth == 0) { + state.tokenize.pop(); + return state.tokenize[state.tokenize.length-1](stream, state); + } + } else if (stream.peek() == "{") { + depth++; + } + return tokenBase(stream, state); + } + t.isBase = true; + return t; + } + + function tokenComment(stream, state) { + var maybeEnd = false, ch; + while (ch = stream.next()) { + if (ch == "/" && maybeEnd) { + state.tokenize.pop(); + break; + } + maybeEnd = (ch == "*"); + } + return "comment"; + } + + function expectExpression(last) { + return !last || last == "operator" || last == "->" || /[\.\[\{\(,;:]/.test(last) || + last == "newstatement" || last == "keyword" || last == "proplabel"; + } + + 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) { + return state.context = new Context(state.indented, 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: [tokenBase], + context: new Context((basecolumn || 0) - config.indentUnit, 0, "top", false), + indented: 0, + startOfLine: true, + lastToken: null + }; + }, + + 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; + // Automatic semicolon insertion + if (ctx.type == "statement" && !expectExpression(state.lastToken)) { + popContext(state); ctx = state.context; + } + } + if (stream.eatSpace()) return null; + curPunc = null; + var style = state.tokenize[state.tokenize.length-1](stream, state); + if (style == "comment") return style; + if (ctx.align == null) ctx.align = true; + + if ((curPunc == ";" || curPunc == ":") && ctx.type == "statement") popContext(state); + // Handle indentation for {x -> \n ... } + else if (curPunc == "->" && ctx.type == "statement" && ctx.prev.type == "}") { + popContext(state); + state.context.align = false; + } + 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" || (ctx.type == "statement" && curPunc == "newstatement")) + pushContext(state, stream.column(), "statement"); + state.startOfLine = false; + state.lastToken = curPunc || style; + return style; + }, + + indent: function(state, textAfter) { + if (!state.tokenize[state.tokenize.length-1].isBase) return 0; + var firstChar = textAfter && textAfter.charAt(0), ctx = state.context; + if (ctx.type == "statement" && !expectExpression(state.lastToken)) ctx = ctx.prev; + var closing = firstChar == ctx.type; + if (ctx.type == "statement") return ctx.indented + (firstChar == "{" ? 0 : config.indentUnit); + else if (ctx.align) return ctx.column + (closing ? 0 : 1); + else return ctx.indented + (closing ? 0 : config.indentUnit); + }, + + electricChars: "{}" + }; +}); + +CodeMirror.defineMIME("text/x-groovy", "groovy"); diff --git a/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/groovy/index.html b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/groovy/index.html new file mode 100644 index 000000000..3d3959577 --- /dev/null +++ b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/groovy/index.html @@ -0,0 +1,73 @@ + + + + + CodeMirror: Groovy mode + + + + + + + + +

CodeMirror: Groovy mode

+ +
+ + + +

MIME types defined: text/x-groovy

+ + diff --git a/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/haml/haml.js b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/haml/haml.js new file mode 100644 index 000000000..793308f6f --- /dev/null +++ b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/haml/haml.js @@ -0,0 +1,153 @@ +(function() { + "use strict"; + + // full haml mode. This handled embeded ruby and html fragments too + CodeMirror.defineMode("haml", function(config) { + var htmlMode = CodeMirror.getMode(config, {name: "htmlmixed"}); + var rubyMode = CodeMirror.getMode(config, "ruby"); + + function rubyInQuote(endQuote) { + return function(stream, state) { + var ch = stream.peek(); + if (ch == endQuote && state.rubyState.tokenize.length == 1) { + // step out of ruby context as it seems to complete processing all the braces + stream.next(); + state.tokenize = html; + return "closeAttributeTag"; + } else { + return ruby(stream, state); + } + }; + } + + function ruby(stream, state) { + if (stream.match("-#")) { + stream.skipToEnd(); + return "comment"; + } + return rubyMode.token(stream, state.rubyState); + } + + function html(stream, state) { + var ch = stream.peek(); + + // handle haml declarations. All declarations that cant be handled here + // will be passed to html mode + if (state.previousToken.style == "comment" ) { + if (state.indented > state.previousToken.indented) { + stream.skipToEnd(); + return "commentLine"; + } + } + + if (state.startOfLine) { + if (ch == "!" && stream.match("!!")) { + stream.skipToEnd(); + return "tag"; + } else if (stream.match(/^%[\w:#\.]+=/)) { + state.tokenize = ruby; + return "hamlTag"; + } else if (stream.match(/^%[\w:]+/)) { + return "hamlTag"; + } else if (ch == "/" ) { + stream.skipToEnd(); + return "comment"; + } + } + + if (state.startOfLine || state.previousToken.style == "hamlTag") { + if ( ch == "#" || ch == ".") { + stream.match(/[\w-#\.]*/); + return "hamlAttribute"; + } + } + + // donot handle --> as valid ruby, make it HTML close comment instead + if (state.startOfLine && !stream.match("-->", false) && (ch == "=" || ch == "-" )) { + state.tokenize = ruby; + return null; + } + + if (state.previousToken.style == "hamlTag" || + state.previousToken.style == "closeAttributeTag" || + state.previousToken.style == "hamlAttribute") { + if (ch == "(") { + state.tokenize = rubyInQuote(")"); + return null; + } else if (ch == "{") { + state.tokenize = rubyInQuote("}"); + return null; + } + } + + return htmlMode.token(stream, state.htmlState); + } + + return { + // default to html mode + startState: function() { + var htmlState = htmlMode.startState(); + var rubyState = rubyMode.startState(); + return { + htmlState: htmlState, + rubyState: rubyState, + indented: 0, + previousToken: { style: null, indented: 0}, + tokenize: html + }; + }, + + copyState: function(state) { + return { + htmlState : CodeMirror.copyState(htmlMode, state.htmlState), + rubyState: CodeMirror.copyState(rubyMode, state.rubyState), + indented: state.indented, + previousToken: state.previousToken, + tokenize: state.tokenize + }; + }, + + token: function(stream, state) { + if (stream.sol()) { + state.indented = stream.indentation(); + state.startOfLine = true; + } + if (stream.eatSpace()) return null; + var style = state.tokenize(stream, state); + state.startOfLine = false; + // dont record comment line as we only want to measure comment line with + // the opening comment block + if (style && style != "commentLine") { + state.previousToken = { style: style, indented: state.indented }; + } + // if current state is ruby and the previous token is not `,` reset the + // tokenize to html + if (stream.eol() && state.tokenize == ruby) { + stream.backUp(1); + var ch = stream.peek(); + stream.next(); + if (ch && ch != ",") { + state.tokenize = html; + } + } + // reprocess some of the specific style tag when finish setting previousToken + if (style == "hamlTag") { + style = "tag"; + } else if (style == "commentLine") { + style = "comment"; + } else if (style == "hamlAttribute") { + style = "attribute"; + } else if (style == "closeAttributeTag") { + style = null; + } + return style; + }, + + indent: function(state) { + return state.indented; + } + }; + }, "htmlmixed", "ruby"); + + CodeMirror.defineMIME("text/x-haml", "haml"); +})(); diff --git a/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/haml/index.html b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/haml/index.html new file mode 100644 index 000000000..7da378fc8 --- /dev/null +++ b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/haml/index.html @@ -0,0 +1,67 @@ + + + + + CodeMirror: HAML mode + + + + + + + + + + + +

CodeMirror: HAML mode

+
+ + +

MIME types defined: text/x-haml.

+ +

Parsing/Highlighting Tests: normal, verbose.

+ + + diff --git a/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/haml/test.js b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/haml/test.js new file mode 100644 index 000000000..b7178d40f --- /dev/null +++ b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/haml/test.js @@ -0,0 +1,94 @@ +(function() { + var mode = CodeMirror.getMode({tabSize: 4}, "haml"); + function MT(name) { test.mode(name, mode, Array.prototype.slice.call(arguments, 1)); } + + // Requires at least one media query + MT("elementName", + "[tag %h1] Hey There"); + + MT("oneElementPerLine", + "[tag %h1] Hey There %h2"); + + MT("idSelector", + "[tag %h1][attribute #test] Hey There"); + + MT("classSelector", + "[tag %h1][attribute .hello] Hey There"); + + MT("docType", + "[tag !!! XML]"); + + MT("comment", + "[comment / Hello WORLD]"); + + MT("notComment", + "[tag %h1] This is not a / comment "); + + MT("attributes", + "[tag %a]([variable title][operator =][string \"test\"]){[atom :title] [operator =>] [string \"test\"]}"); + + MT("htmlCode", + "[tag

]Title[tag

]"); + + MT("rubyBlock", + "[operator =][variable-2 @item]"); + + MT("selectorRubyBlock", + "[tag %a.selector=] [variable-2 @item]"); + + MT("nestedRubyBlock", + "[tag %a]", + " [operator =][variable puts] [string \"test\"]"); + + MT("multilinePlaintext", + "[tag %p]", + " Hello,", + " World"); + + MT("multilineRuby", + "[tag %p]", + " [comment -# this is a comment]", + " [comment and this is a comment too]", + " Date/Time", + " [operator -] [variable now] [operator =] [tag DateTime][operator .][variable now]", + " [tag %strong=] [variable now]", + " [operator -] [keyword if] [variable now] [operator >] [tag DateTime][operator .][variable parse]([string \"December 31, 2006\"])", + " [operator =][string \"Happy\"]", + " [operator =][string \"Belated\"]", + " [operator =][string \"Birthday\"]"); + + MT("multilineComment", + "[comment /]", + " [comment Multiline]", + " [comment Comment]"); + + MT("hamlComment", + "[comment -# this is a comment]"); + + MT("multilineHamlComment", + "[comment -# this is a comment]", + " [comment and this is a comment too]"); + + MT("multilineHTMLComment", + "[comment ]"); + + MT("hamlAfterRubyTag", + "[attribute .block]", + " [tag %strong=] [variable now]", + " [attribute .test]", + " [operator =][variable now]", + " [attribute .right]"); + + MT("stretchedRuby", + "[operator =] [variable puts] [string \"Hello\"],", + " [string \"World\"]"); + + MT("interpolationInHashAttribute", + //"[tag %div]{[atom :id] [operator =>] [string \"#{][variable test][string }_#{][variable ting][string }\"]} test"); + "[tag %div]{[atom :id] [operator =>] [string \"#{][variable test][string }_#{][variable ting][string }\"]} test"); + + MT("interpolationInHTMLAttribute", + "[tag %div]([variable title][operator =][string \"#{][variable test][string }_#{][variable ting]()[string }\"]) Test"); +})(); diff --git a/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/haskell/haskell.js b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/haskell/haskell.js new file mode 100644 index 000000000..b18d5ced1 --- /dev/null +++ b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/haskell/haskell.js @@ -0,0 +1,246 @@ +CodeMirror.defineMode("haskell", function() { + + function switchState(source, setState, f) { + setState(f); + return f(source, setState); + } + + // These should all be Unicode extended, as per the Haskell 2010 report + var smallRE = /[a-z_]/; + var largeRE = /[A-Z]/; + var digitRE = /[0-9]/; + var hexitRE = /[0-9A-Fa-f]/; + var octitRE = /[0-7]/; + var idRE = /[a-z_A-Z0-9']/; + var symbolRE = /[-!#$%&*+.\/<=>?@\\^|~:]/; + var specialRE = /[(),;[\]`{}]/; + var whiteCharRE = /[ \t\v\f]/; // newlines are handled in tokenizer + + function normal(source, setState) { + if (source.eatWhile(whiteCharRE)) { + return null; + } + + var ch = source.next(); + if (specialRE.test(ch)) { + if (ch == '{' && source.eat('-')) { + var t = "comment"; + if (source.eat('#')) { + t = "meta"; + } + return switchState(source, setState, ncomment(t, 1)); + } + return null; + } + + if (ch == '\'') { + if (source.eat('\\')) { + source.next(); // should handle other escapes here + } + else { + source.next(); + } + if (source.eat('\'')) { + return "string"; + } + return "error"; + } + + if (ch == '"') { + return switchState(source, setState, stringLiteral); + } + + if (largeRE.test(ch)) { + source.eatWhile(idRE); + if (source.eat('.')) { + return "qualifier"; + } + return "variable-2"; + } + + if (smallRE.test(ch)) { + source.eatWhile(idRE); + return "variable"; + } + + if (digitRE.test(ch)) { + if (ch == '0') { + if (source.eat(/[xX]/)) { + source.eatWhile(hexitRE); // should require at least 1 + return "integer"; + } + if (source.eat(/[oO]/)) { + source.eatWhile(octitRE); // should require at least 1 + return "number"; + } + } + source.eatWhile(digitRE); + var t = "number"; + if (source.eat('.')) { + t = "number"; + source.eatWhile(digitRE); // should require at least 1 + } + if (source.eat(/[eE]/)) { + t = "number"; + source.eat(/[-+]/); + source.eatWhile(digitRE); // should require at least 1 + } + return t; + } + + if (symbolRE.test(ch)) { + if (ch == '-' && source.eat(/-/)) { + source.eatWhile(/-/); + if (!source.eat(symbolRE)) { + source.skipToEnd(); + return "comment"; + } + } + var t = "variable"; + if (ch == ':') { + t = "variable-2"; + } + source.eatWhile(symbolRE); + return t; + } + + return "error"; + } + + function ncomment(type, nest) { + if (nest == 0) { + return normal; + } + return function(source, setState) { + var currNest = nest; + while (!source.eol()) { + var ch = source.next(); + if (ch == '{' && source.eat('-')) { + ++currNest; + } + else if (ch == '-' && source.eat('}')) { + --currNest; + if (currNest == 0) { + setState(normal); + return type; + } + } + } + setState(ncomment(type, currNest)); + return type; + }; + } + + function stringLiteral(source, setState) { + while (!source.eol()) { + var ch = source.next(); + if (ch == '"') { + setState(normal); + return "string"; + } + if (ch == '\\') { + if (source.eol() || source.eat(whiteCharRE)) { + setState(stringGap); + return "string"; + } + if (source.eat('&')) { + } + else { + source.next(); // should handle other escapes here + } + } + } + setState(normal); + return "error"; + } + + function stringGap(source, setState) { + if (source.eat('\\')) { + return switchState(source, setState, stringLiteral); + } + source.next(); + setState(normal); + return "error"; + } + + + var wellKnownWords = (function() { + var wkw = {}; + function setType(t) { + return function () { + for (var i = 0; i < arguments.length; i++) + wkw[arguments[i]] = t; + }; + } + + setType("keyword")( + "case", "class", "data", "default", "deriving", "do", "else", "foreign", + "if", "import", "in", "infix", "infixl", "infixr", "instance", "let", + "module", "newtype", "of", "then", "type", "where", "_"); + + setType("keyword")( + "\.\.", ":", "::", "=", "\\", "\"", "<-", "->", "@", "~", "=>"); + + setType("builtin")( + "!!", "$!", "$", "&&", "+", "++", "-", ".", "/", "/=", "<", "<=", "=<<", + "==", ">", ">=", ">>", ">>=", "^", "^^", "||", "*", "**"); + + setType("builtin")( + "Bool", "Bounded", "Char", "Double", "EQ", "Either", "Enum", "Eq", + "False", "FilePath", "Float", "Floating", "Fractional", "Functor", "GT", + "IO", "IOError", "Int", "Integer", "Integral", "Just", "LT", "Left", + "Maybe", "Monad", "Nothing", "Num", "Ord", "Ordering", "Rational", "Read", + "ReadS", "Real", "RealFloat", "RealFrac", "Right", "Show", "ShowS", + "String", "True"); + + setType("builtin")( + "abs", "acos", "acosh", "all", "and", "any", "appendFile", "asTypeOf", + "asin", "asinh", "atan", "atan2", "atanh", "break", "catch", "ceiling", + "compare", "concat", "concatMap", "const", "cos", "cosh", "curry", + "cycle", "decodeFloat", "div", "divMod", "drop", "dropWhile", "either", + "elem", "encodeFloat", "enumFrom", "enumFromThen", "enumFromThenTo", + "enumFromTo", "error", "even", "exp", "exponent", "fail", "filter", + "flip", "floatDigits", "floatRadix", "floatRange", "floor", "fmap", + "foldl", "foldl1", "foldr", "foldr1", "fromEnum", "fromInteger", + "fromIntegral", "fromRational", "fst", "gcd", "getChar", "getContents", + "getLine", "head", "id", "init", "interact", "ioError", "isDenormalized", + "isIEEE", "isInfinite", "isNaN", "isNegativeZero", "iterate", "last", + "lcm", "length", "lex", "lines", "log", "logBase", "lookup", "map", + "mapM", "mapM_", "max", "maxBound", "maximum", "maybe", "min", "minBound", + "minimum", "mod", "negate", "not", "notElem", "null", "odd", "or", + "otherwise", "pi", "pred", "print", "product", "properFraction", + "putChar", "putStr", "putStrLn", "quot", "quotRem", "read", "readFile", + "readIO", "readList", "readLn", "readParen", "reads", "readsPrec", + "realToFrac", "recip", "rem", "repeat", "replicate", "return", "reverse", + "round", "scaleFloat", "scanl", "scanl1", "scanr", "scanr1", "seq", + "sequence", "sequence_", "show", "showChar", "showList", "showParen", + "showString", "shows", "showsPrec", "significand", "signum", "sin", + "sinh", "snd", "span", "splitAt", "sqrt", "subtract", "succ", "sum", + "tail", "take", "takeWhile", "tan", "tanh", "toEnum", "toInteger", + "toRational", "truncate", "uncurry", "undefined", "unlines", "until", + "unwords", "unzip", "unzip3", "userError", "words", "writeFile", "zip", + "zip3", "zipWith", "zipWith3"); + + return wkw; + })(); + + + + return { + startState: function () { return { f: normal }; }, + copyState: function (s) { return { f: s.f }; }, + + token: function(stream, state) { + var t = state.f(stream, function(s) { state.f = s; }); + var w = stream.current(); + return (w in wellKnownWords) ? wellKnownWords[w] : t; + }, + + blockCommentStart: "{-", + blockCommentEnd: "-}", + lineComment: "--" + }; + +}); + +CodeMirror.defineMIME("text/x-haskell", "haskell"); diff --git a/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/haskell/index.html b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/haskell/index.html new file mode 100644 index 000000000..56307b8a9 --- /dev/null +++ b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/haskell/index.html @@ -0,0 +1,62 @@ + + + + + CodeMirror: Haskell mode + + + + + + + + + +

CodeMirror: Haskell mode

+ +
+ + + +

MIME types defined: text/x-haskell.

+ + diff --git a/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/haxe/haxe.js b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/haxe/haxe.js new file mode 100644 index 000000000..65c5d5d2e --- /dev/null +++ b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/haxe/haxe.js @@ -0,0 +1,429 @@ +CodeMirror.defineMode("haxe", function(config, parserConfig) { + var indentUnit = config.indentUnit; + + // Tokenizer + + var keywords = function(){ + function kw(type) {return {type: type, style: "keyword"};} + var A = kw("keyword a"), B = kw("keyword b"), C = kw("keyword c"); + var operator = kw("operator"), atom = {type: "atom", style: "atom"}, attribute = {type:"attribute", style: "attribute"}; + var type = kw("typedef"); + return { + "if": A, "while": A, "else": B, "do": B, "try": B, + "return": C, "break": C, "continue": C, "new": C, "throw": C, + "var": kw("var"), "inline":attribute, "static": attribute, "using":kw("import"), + "public": attribute, "private": attribute, "cast": kw("cast"), "import": kw("import"), "macro": kw("macro"), + "function": kw("function"), "catch": kw("catch"), "untyped": kw("untyped"), "callback": kw("cb"), + "for": kw("for"), "switch": kw("switch"), "case": kw("case"), "default": kw("default"), + "in": operator, "never": kw("property_access"), "trace":kw("trace"), + "class": type, "enum":type, "interface":type, "typedef":type, "extends":type, "implements":type, "dynamic":type, + "true": atom, "false": atom, "null": atom + }; + }(); + + var isOperatorChar = /[+\-*&%=<>!?|]/; + + function chain(stream, state, f) { + state.tokenize = f; + return f(stream, state); + } + + function nextUntilUnescaped(stream, end) { + var escaped = false, next; + while ((next = stream.next()) != null) { + if (next == end && !escaped) + return false; + escaped = !escaped && next == "\\"; + } + return escaped; + } + + // Used as scratch variables to communicate multiple values without + // consing up tons of objects. + var type, content; + function ret(tp, style, cont) { + type = tp; content = cont; + return style; + } + + function haxeTokenBase(stream, state) { + var ch = stream.next(); + if (ch == '"' || ch == "'") + return chain(stream, state, haxeTokenString(ch)); + else if (/[\[\]{}\(\),;\:\.]/.test(ch)) + return ret(ch); + else if (ch == "0" && stream.eat(/x/i)) { + stream.eatWhile(/[\da-f]/i); + return ret("number", "number"); + } + else if (/\d/.test(ch) || ch == "-" && stream.eat(/\d/)) { + stream.match(/^\d*(?:\.\d*)?(?:[eE][+\-]?\d+)?/); + return ret("number", "number"); + } + else if (state.reAllowed && (ch == "~" && stream.eat(/\//))) { + nextUntilUnescaped(stream, "/"); + stream.eatWhile(/[gimsu]/); + return ret("regexp", "string-2"); + } + else if (ch == "/") { + if (stream.eat("*")) { + return chain(stream, state, haxeTokenComment); + } + else if (stream.eat("/")) { + stream.skipToEnd(); + return ret("comment", "comment"); + } + else { + stream.eatWhile(isOperatorChar); + return ret("operator", null, stream.current()); + } + } + else if (ch == "#") { + stream.skipToEnd(); + return ret("conditional", "meta"); + } + else if (ch == "@") { + stream.eat(/:/); + stream.eatWhile(/[\w_]/); + return ret ("metadata", "meta"); + } + else if (isOperatorChar.test(ch)) { + stream.eatWhile(isOperatorChar); + return ret("operator", null, stream.current()); + } + else { + var word; + if(/[A-Z]/.test(ch)) + { + stream.eatWhile(/[\w_<>]/); + word = stream.current(); + return ret("type", "variable-3", word); + } + else + { + stream.eatWhile(/[\w_]/); + var word = stream.current(), known = keywords.propertyIsEnumerable(word) && keywords[word]; + return (known && state.kwAllowed) ? ret(known.type, known.style, word) : + ret("variable", "variable", word); + } + } + } + + function haxeTokenString(quote) { + return function(stream, state) { + if (!nextUntilUnescaped(stream, quote)) + state.tokenize = haxeTokenBase; + return ret("string", "string"); + }; + } + + function haxeTokenComment(stream, state) { + var maybeEnd = false, ch; + while (ch = stream.next()) { + if (ch == "/" && maybeEnd) { + state.tokenize = haxeTokenBase; + break; + } + maybeEnd = (ch == "*"); + } + return ret("comment", "comment"); + } + + // Parser + + var atomicTypes = {"atom": true, "number": true, "variable": true, "string": true, "regexp": true}; + + function HaxeLexical(indented, column, type, align, prev, info) { + this.indented = indented; + this.column = column; + this.type = type; + this.prev = prev; + this.info = info; + if (align != null) this.align = align; + } + + function inScope(state, varname) { + for (var v = state.localVars; v; v = v.next) + if (v.name == varname) return true; + } + + function parseHaxe(state, style, type, content, stream) { + var cc = state.cc; + // Communicate our context to the combinators. + // (Less wasteful than consing up a hundred closures on every call.) + cx.state = state; cx.stream = stream; cx.marked = null, cx.cc = cc; + + if (!state.lexical.hasOwnProperty("align")) + state.lexical.align = true; + + while(true) { + var combinator = cc.length ? cc.pop() : statement; + if (combinator(type, content)) { + while(cc.length && cc[cc.length - 1].lex) + cc.pop()(); + if (cx.marked) return cx.marked; + if (type == "variable" && inScope(state, content)) return "variable-2"; + if (type == "variable" && imported(state, content)) return "variable-3"; + return style; + } + } + } + + function imported(state, typename) + { + if (/[a-z]/.test(typename.charAt(0))) + return false; + var len = state.importedtypes.length; + for (var i = 0; i= 0; i--) cx.cc.push(arguments[i]); + } + function cont() { + pass.apply(null, arguments); + return true; + } + function register(varname) { + var state = cx.state; + if (state.context) { + cx.marked = "def"; + for (var v = state.localVars; v; v = v.next) + if (v.name == varname) return; + state.localVars = {name: varname, next: state.localVars}; + } + } + + // Combinators + + var defaultVars = {name: "this", next: null}; + function pushcontext() { + if (!cx.state.context) cx.state.localVars = defaultVars; + cx.state.context = {prev: cx.state.context, vars: cx.state.localVars}; + } + function popcontext() { + cx.state.localVars = cx.state.context.vars; + cx.state.context = cx.state.context.prev; + } + function pushlex(type, info) { + var result = function() { + var state = cx.state; + state.lexical = new HaxeLexical(state.indented, cx.stream.column(), type, null, state.lexical, info); + }; + result.lex = true; + return result; + } + function poplex() { + var state = cx.state; + if (state.lexical.prev) { + if (state.lexical.type == ")") + state.indented = state.lexical.indented; + state.lexical = state.lexical.prev; + } + } + poplex.lex = true; + + function expect(wanted) { + return function(type) { + if (type == wanted) return cont(); + else if (wanted == ";") return pass(); + else return cont(arguments.callee); + }; + } + + function statement(type) { + if (type == "@") return cont(metadef); + if (type == "var") return cont(pushlex("vardef"), vardef1, expect(";"), poplex); + if (type == "keyword a") return cont(pushlex("form"), expression, statement, poplex); + if (type == "keyword b") return cont(pushlex("form"), statement, poplex); + if (type == "{") return cont(pushlex("}"), pushcontext, block, poplex, popcontext); + if (type == ";") return cont(); + if (type == "attribute") return cont(maybeattribute); + if (type == "function") return cont(functiondef); + if (type == "for") return cont(pushlex("form"), expect("("), pushlex(")"), forspec1, expect(")"), + poplex, statement, poplex); + if (type == "variable") return cont(pushlex("stat"), maybelabel); + if (type == "switch") return cont(pushlex("form"), expression, pushlex("}", "switch"), expect("{"), + block, poplex, poplex); + if (type == "case") return cont(expression, expect(":")); + if (type == "default") return cont(expect(":")); + if (type == "catch") return cont(pushlex("form"), pushcontext, expect("("), funarg, expect(")"), + statement, poplex, popcontext); + if (type == "import") return cont(importdef, expect(";")); + if (type == "typedef") return cont(typedef); + return pass(pushlex("stat"), expression, expect(";"), poplex); + } + function expression(type) { + if (atomicTypes.hasOwnProperty(type)) return cont(maybeoperator); + if (type == "function") return cont(functiondef); + if (type == "keyword c") return cont(maybeexpression); + if (type == "(") return cont(pushlex(")"), maybeexpression, expect(")"), poplex, maybeoperator); + if (type == "operator") return cont(expression); + if (type == "[") return cont(pushlex("]"), commasep(expression, "]"), poplex, maybeoperator); + if (type == "{") return cont(pushlex("}"), commasep(objprop, "}"), poplex, maybeoperator); + return cont(); + } + function maybeexpression(type) { + if (type.match(/[;\}\)\],]/)) return pass(); + return pass(expression); + } + + function maybeoperator(type, value) { + if (type == "operator" && /\+\+|--/.test(value)) return cont(maybeoperator); + if (type == "operator" || type == ":") return cont(expression); + if (type == ";") return; + if (type == "(") return cont(pushlex(")"), commasep(expression, ")"), poplex, maybeoperator); + if (type == ".") return cont(property, maybeoperator); + if (type == "[") return cont(pushlex("]"), expression, expect("]"), poplex, maybeoperator); + } + + function maybeattribute(type) { + if (type == "attribute") return cont(maybeattribute); + if (type == "function") return cont(functiondef); + if (type == "var") return cont(vardef1); + } + + function metadef(type) { + if(type == ":") return cont(metadef); + if(type == "variable") return cont(metadef); + if(type == "(") return cont(pushlex(")"), comasep(metaargs, ")"), poplex, statement); + } + function metaargs(type) { + if(type == "variable") return cont(); + } + + function importdef (type, value) { + if(type == "variable" && /[A-Z]/.test(value.charAt(0))) { registerimport(value); return cont(); } + else if(type == "variable" || type == "property" || type == ".") return cont(importdef); + } + + function typedef (type, value) + { + if(type == "variable" && /[A-Z]/.test(value.charAt(0))) { registerimport(value); return cont(); } + } + + function maybelabel(type) { + if (type == ":") return cont(poplex, statement); + return pass(maybeoperator, expect(";"), poplex); + } + function property(type) { + if (type == "variable") {cx.marked = "property"; return cont();} + } + function objprop(type) { + if (type == "variable") cx.marked = "property"; + if (atomicTypes.hasOwnProperty(type)) return cont(expect(":"), expression); + } + function commasep(what, end) { + function proceed(type) { + if (type == ",") return cont(what, proceed); + if (type == end) return cont(); + return cont(expect(end)); + } + return function(type) { + if (type == end) return cont(); + else return pass(what, proceed); + }; + } + function block(type) { + if (type == "}") return cont(); + return pass(statement, block); + } + function vardef1(type, value) { + if (type == "variable"){register(value); return cont(typeuse, vardef2);} + return cont(); + } + function vardef2(type, value) { + if (value == "=") return cont(expression, vardef2); + if (type == ",") return cont(vardef1); + } + function forspec1(type, value) { + if (type == "variable") { + register(value); + } + return cont(pushlex(")"), pushcontext, forin, expression, poplex, statement, popcontext); + } + function forin(_type, value) { + if (value == "in") return cont(); + } + function functiondef(type, value) { + if (type == "variable") {register(value); return cont(functiondef);} + if (value == "new") return cont(functiondef); + if (type == "(") return cont(pushlex(")"), pushcontext, commasep(funarg, ")"), poplex, typeuse, statement, popcontext); + } + function typeuse(type) { + if(type == ":") return cont(typestring); + } + function typestring(type) { + if(type == "type") return cont(); + if(type == "variable") return cont(); + if(type == "{") return cont(pushlex("}"), commasep(typeprop, "}"), poplex); + } + function typeprop(type) { + if(type == "variable") return cont(typeuse); + } + function funarg(type, value) { + if (type == "variable") {register(value); return cont(typeuse);} + } + + // Interface + + return { + startState: function(basecolumn) { + var defaulttypes = ["Int", "Float", "String", "Void", "Std", "Bool", "Dynamic", "Array"]; + return { + tokenize: haxeTokenBase, + reAllowed: true, + kwAllowed: true, + cc: [], + lexical: new HaxeLexical((basecolumn || 0) - indentUnit, 0, "block", false), + localVars: parserConfig.localVars, + importedtymixerp: defaulttypes, + context: parserConfig.localVars && {vars: parserConfig.localVars}, + indented: 0 + }; + }, + + token: function(stream, state) { + if (stream.sol()) { + if (!state.lexical.hasOwnProperty("align")) + state.lexical.align = false; + state.indented = stream.indentation(); + } + if (stream.eatSpace()) return null; + var style = state.tokenize(stream, state); + if (type == "comment") return style; + state.reAllowed = !!(type == "operator" || type == "keyword c" || type.match(/^[\[{}\(,;:]$/)); + state.kwAllowed = type != '.'; + return parseHaxe(state, style, type, content, stream); + }, + + indent: function(state, textAfter) { + if (state.tokenize != haxeTokenBase) return 0; + var firstChar = textAfter && textAfter.charAt(0), lexical = state.lexical; + if (lexical.type == "stat" && firstChar == "}") lexical = lexical.prev; + var type = lexical.type, closing = firstChar == type; + if (type == "vardef") return lexical.indented + 4; + else if (type == "form" && firstChar == "{") return lexical.indented; + else if (type == "stat" || type == "form") return lexical.indented + indentUnit; + else if (lexical.info == "switch" && !closing) + return lexical.indented + (/^(?:case|default)\b/.test(textAfter) ? indentUnit : 2 * indentUnit); + else if (lexical.align) return lexical.column + (closing ? 0 : 1); + else return lexical.indented + (closing ? 0 : indentUnit); + }, + + electricChars: "{}" + }; +}); + +CodeMirror.defineMIME("text/x-haxe", "haxe"); diff --git a/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/haxe/index.html b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/haxe/index.html new file mode 100644 index 000000000..1125741ad --- /dev/null +++ b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/haxe/index.html @@ -0,0 +1,90 @@ + + + + + CodeMirror: Haxe mode + + + + + + + +

CodeMirror: Haxe mode

+ +
+ + + +

MIME types defined: text/x-haxe.

+ + diff --git a/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/htmlembedded/htmlembedded.js b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/htmlembedded/htmlembedded.js new file mode 100644 index 000000000..ff6dfd2f9 --- /dev/null +++ b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/htmlembedded/htmlembedded.js @@ -0,0 +1,73 @@ +CodeMirror.defineMode("htmlembedded", function(config, parserConfig) { + + //config settings + var scriptStartRegex = parserConfig.scriptStartRegex || /^<%/i, + scriptEndRegex = parserConfig.scriptEndRegex || /^%>/i; + + //inner modes + var scriptingMode, htmlMixedMode; + + //tokenizer when in html mode + function htmlDispatch(stream, state) { + if (stream.match(scriptStartRegex, false)) { + state.token=scriptingDispatch; + return scriptingMode.token(stream, state.scriptState); + } + else + return htmlMixedMode.token(stream, state.htmlState); + } + + //tokenizer when in scripting mode + function scriptingDispatch(stream, state) { + if (stream.match(scriptEndRegex, false)) { + state.token=htmlDispatch; + return htmlMixedMode.token(stream, state.htmlState); + } + else + return scriptingMode.token(stream, state.scriptState); + } + + + return { + startState: function() { + scriptingMode = scriptingMode || CodeMirror.getMode(config, parserConfig.scriptingModeSpec); + htmlMixedMode = htmlMixedMode || CodeMirror.getMode(config, "htmlmixed"); + return { + token : parserConfig.startOpen ? scriptingDispatch : htmlDispatch, + htmlState : CodeMirror.startState(htmlMixedMode), + scriptState : CodeMirror.startState(scriptingMode) + }; + }, + + token: function(stream, state) { + return state.token(stream, state); + }, + + indent: function(state, textAfter) { + if (state.token == htmlDispatch) + return htmlMixedMode.indent(state.htmlState, textAfter); + else if (scriptingMode.indent) + return scriptingMode.indent(state.scriptState, textAfter); + }, + + copyState: function(state) { + return { + token : state.token, + htmlState : CodeMirror.copyState(htmlMixedMode, state.htmlState), + scriptState : CodeMirror.copyState(scriptingMode, state.scriptState) + }; + }, + + electricChars: "/{}:", + + innerMode: function(state) { + if (state.token == scriptingDispatch) return {state: state.scriptState, mode: scriptingMode}; + else return {state: state.htmlState, mode: htmlMixedMode}; + } + }; +}, "htmlmixed"); + +CodeMirror.defineMIME("application/x-ejs", { name: "htmlembedded", scriptingModeSpec:"javascript"}); +CodeMirror.defineMIME("application/x-aspx", { name: "htmlembedded", scriptingModeSpec:"text/x-csharp"}); +CodeMirror.defineMIME("application/x-jsp", { name: "htmlembedded", scriptingModeSpec:"text/x-java"}); +CodeMirror.defineMIME("application/x-erb", { name: "htmlembedded", scriptingModeSpec:"ruby"}); diff --git a/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/htmlembedded/index.html b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/htmlembedded/index.html new file mode 100644 index 000000000..5a37dd637 --- /dev/null +++ b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/htmlembedded/index.html @@ -0,0 +1,49 @@ + + + + + CodeMirror: Html Embedded Scripts mode + + + + + + + + + + + +

CodeMirror: Html Embedded Scripts mode

+ +
+ + + +

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.

+ +

MIME types defined: application/x-aspx (ASP.NET), + application/x-ejs (Embedded Javascript), application/x-jsp (JavaServer Pages)

+ + diff --git a/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/htmlmixed/htmlmixed.js b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/htmlmixed/htmlmixed.js new file mode 100644 index 000000000..ec0c21d24 --- /dev/null +++ b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/htmlmixed/htmlmixed.js @@ -0,0 +1,104 @@ +CodeMirror.defineMode("htmlmixed", function(config, parserConfig) { + var htmlMode = CodeMirror.getMode(config, {name: "xml", htmlMode: true}); + var cssMode = CodeMirror.getMode(config, "css"); + + var scriptTypes = [], scriptTypesConf = parserConfig && parserConfig.scriptTypes; + scriptTypes.push({matches: /^(?:text|application)\/(?:x-)?(?:java|ecma)script$|^$/i, + mode: CodeMirror.getMode(config, "javascript")}); + if (scriptTypesConf) for (var i = 0; i < scriptTypesConf.length; ++i) { + var conf = scriptTypesConf[i]; + scriptTypes.push({matches: conf.matches, mode: conf.mode && CodeMirror.getMode(config, conf.mode)}); + } + scriptTypes.push({matches: /./, + mode: CodeMirror.getMode(config, "text/plain")}); + + function html(stream, state) { + var tagName = state.htmlState.tagName; + var style = htmlMode.token(stream, state.htmlState); + if (tagName == "script" && /\btag\b/.test(style) && stream.current() == ">") { + // Script block: mode to change to depends on type attribute + var scriptType = stream.string.slice(Math.max(0, stream.pos - 100), stream.pos).match(/\btype\s*=\s*("[^"]+"|'[^']+'|\S+)[^<]*$/i); + scriptType = scriptType ? scriptType[1] : ""; + if (scriptType && /[\"\']/.test(scriptType.charAt(0))) scriptType = scriptType.slice(1, scriptType.length - 1); + for (var i = 0; i < scriptTypes.length; ++i) { + var tp = scriptTypes[i]; + if (typeof tp.matches == "string" ? scriptType == tp.matches : tp.matches.test(scriptType)) { + if (tp.mode) { + state.token = script; + state.localMode = tp.mode; + state.localState = tp.mode.startState && tp.mode.startState(htmlMode.indent(state.htmlState, "")); + } + break; + } + } + } else if (tagName == "style" && /\btag\b/.test(style) && stream.current() == ">") { + state.token = css; + state.localMode = cssMode; + state.localState = cssMode.startState(htmlMode.indent(state.htmlState, "")); + } + return style; + } + function maybeBackup(stream, pat, style) { + var cur = stream.current(); + var close = cur.search(pat), m; + if (close > -1) stream.backUp(cur.length - close); + else if (m = cur.match(/<\/?$/)) { + stream.backUp(cur.length); + if (!stream.match(pat, false)) stream.match(cur[0]); + } + return style; + } + function script(stream, state) { + if (stream.match(/^<\/\s*script\s*>/i, false)) { + state.token = html; + state.localState = state.localMode = null; + return html(stream, state); + } + return maybeBackup(stream, /<\/\s*script\s*>/, + state.localMode.token(stream, state.localState)); + } + function css(stream, state) { + if (stream.match(/^<\/\s*style\s*>/i, false)) { + state.token = html; + state.localState = state.localMode = null; + return html(stream, state); + } + return maybeBackup(stream, /<\/\s*style\s*>/, + cssMode.token(stream, state.localState)); + } + + return { + startState: function() { + var state = htmlMode.startState(); + return {token: html, localMode: null, localState: null, htmlState: state}; + }, + + copyState: function(state) { + if (state.localState) + var local = CodeMirror.copyState(state.localMode, state.localState); + return {token: state.token, localMode: state.localMode, localState: local, + htmlState: CodeMirror.copyState(htmlMode, state.htmlState)}; + }, + + token: function(stream, state) { + return state.token(stream, state); + }, + + indent: function(state, textAfter) { + if (!state.localMode || /^\s*<\//.test(textAfter)) + return htmlMode.indent(state.htmlState, textAfter); + else if (state.localMode.indent) + return state.localMode.indent(state.localState, textAfter); + else + return CodeMirror.Pass; + }, + + electricChars: "/{}:", + + innerMode: function(state) { + return {state: state.localState || state.htmlState, mode: state.localMode || htmlMode}; + } + }; +}, "xml", "javascript", "css"); + +CodeMirror.defineMIME("text/html", "htmlmixed"); diff --git a/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/htmlmixed/index.html b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/htmlmixed/index.html new file mode 100644 index 000000000..98dadd62d --- /dev/null +++ b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/htmlmixed/index.html @@ -0,0 +1,73 @@ + + + + + CodeMirror: HTML mixed mode + + + + + + + + + + + +

CodeMirror: HTML mixed mode

+
+ + +

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).

+ + + diff --git a/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/http/http.js b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/http/http.js new file mode 100644 index 000000000..5a5163602 --- /dev/null +++ b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/http/http.js @@ -0,0 +1,98 @@ +CodeMirror.defineMode("http", function() { + function failFirstLine(stream, state) { + stream.skipToEnd(); + state.cur = header; + return "error"; + } + + function start(stream, state) { + if (stream.match(/^HTTP\/\d\.\d/)) { + state.cur = responseStatusCode; + return "keyword"; + } else if (stream.match(/^[A-Z]+/) && /[ \t]/.test(stream.peek())) { + state.cur = requestPath; + return "keyword"; + } else { + return failFirstLine(stream, state); + } + } + + function responseStatusCode(stream, state) { + var code = stream.match(/^\d+/); + if (!code) return failFirstLine(stream, state); + + state.cur = responseStatusText; + var status = Number(code[0]); + if (status >= 100 && status < 200) { + return "positive informational"; + } else if (status >= 200 && status < 300) { + return "positive success"; + } else if (status >= 300 && status < 400) { + return "positive redirect"; + } else if (status >= 400 && status < 500) { + return "negative client-error"; + } else if (status >= 500 && status < 600) { + return "negative server-error"; + } else { + return "error"; + } + } + + function responseStatusText(stream, state) { + stream.skipToEnd(); + state.cur = header; + return null; + } + + function requestPath(stream, state) { + stream.eatWhile(/\S/); + state.cur = requestProtocol; + return "string-2"; + } + + function requestProtocol(stream, state) { + if (stream.match(/^HTTP\/\d\.\d$/)) { + state.cur = header; + return "keyword"; + } else { + return failFirstLine(stream, state); + } + } + + function header(stream) { + if (stream.sol() && !stream.eat(/[ \t]/)) { + if (stream.match(/^.*?:/)) { + return "atom"; + } else { + stream.skipToEnd(); + return "error"; + } + } else { + stream.skipToEnd(); + return "string"; + } + } + + function body(stream) { + stream.skipToEnd(); + return null; + } + + return { + token: function(stream, state) { + var cur = state.cur; + if (cur != header && cur != body && stream.eatSpace()) return null; + return cur(stream, state); + }, + + blankLine: function(state) { + state.cur = body; + }, + + startState: function() { + return {cur: start}; + } + }; +}); + +CodeMirror.defineMIME("message/http", "http"); diff --git a/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/http/index.html b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/http/index.html new file mode 100644 index 000000000..124eb84f9 --- /dev/null +++ b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/http/index.html @@ -0,0 +1,32 @@ + + + + + CodeMirror: HTTP mode + + + + + + + +

CodeMirror: HTTP mode

+ +
+ + + +

MIME types defined: message/http.

+ + diff --git a/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/javascript/index.html b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/javascript/index.html new file mode 100644 index 000000000..db063b772 --- /dev/null +++ b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/javascript/index.html @@ -0,0 +1,94 @@ + + + + + CodeMirror: JavaScript mode + + + + + + + + + + +

CodeMirror: JavaScript mode

+ +
+ + + +

+ JavaScript mode supports a two configuration + options: +

    +
  • json which will set the mode to expect JSON + data rather than a JavaScript program.
  • +
  • typescript which will activate additional + syntax highlighting and some other things for TypeScript code + (demo).
  • +
  • statementIndent which (given a number) will + determine the amount of indentation to use for statements + continued on a new line.
  • +
+

+ +

MIME types defined: text/javascript, application/json, text/typescript, application/typescript.

+ + diff --git a/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/javascript/javascript.js b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/javascript/javascript.js new file mode 100644 index 000000000..6435e138d --- /dev/null +++ b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/javascript/javascript.js @@ -0,0 +1,476 @@ +// TODO actually recognize syntax of TypeScript constructs + +CodeMirror.defineMode("javascript", function(config, parserConfig) { + var indentUnit = config.indentUnit; + var statementIndent = parserConfig.statementIndent; + var jsonMode = parserConfig.json; + var isTS = parserConfig.typescript; + + // Tokenizer + + var keywords = function(){ + function kw(type) {return {type: type, style: "keyword"};} + var A = kw("keyword a"), B = kw("keyword b"), C = kw("keyword c"); + var operator = kw("operator"), atom = {type: "atom", style: "atom"}; + + var jsKeywords = { + "if": kw("if"), "while": A, "with": A, "else": B, "do": B, "try": B, "finally": B, + "return": C, "break": C, "continue": C, "new": C, "delete": C, "throw": C, + "var": kw("var"), "const": kw("var"), "let": kw("var"), + "function": kw("function"), "catch": kw("catch"), + "for": kw("for"), "switch": kw("switch"), "case": kw("case"), "default": kw("default"), + "in": operator, "typeof": operator, "instanceof": operator, + "true": atom, "false": atom, "null": atom, "undefined": atom, "NaN": atom, "Infinity": atom, + "this": kw("this") + }; + + // Extend the 'normal' keywords with the TypeScript language extensions + if (isTS) { + var type = {type: "variable", style: "variable-3"}; + var tsKeywords = { + // object-like things + "interface": kw("interface"), + "class": kw("class"), + "extends": kw("extends"), + "constructor": kw("constructor"), + + // scope modifiers + "public": kw("public"), + "private": kw("private"), + "protected": kw("protected"), + "static": kw("static"), + + "super": kw("super"), + + // types + "string": type, "number": type, "bool": type, "any": type + }; + + for (var attr in tsKeywords) { + jsKeywords[attr] = tsKeywords[attr]; + } + } + + return jsKeywords; + }(); + + var isOperatorChar = /[+\-*&%=<>!?|~^]/; + + function chain(stream, state, f) { + state.tokenize = f; + return f(stream, state); + } + + function nextUntilUnescaped(stream, end) { + var escaped = false, next; + while ((next = stream.next()) != null) { + if (next == end && !escaped) + return false; + escaped = !escaped && next == "\\"; + } + return escaped; + } + + // Used as scratch variables to communicate multiple values without + // consing up tons of objects. + var type, content; + function ret(tp, style, cont) { + type = tp; content = cont; + return style; + } + + function jsTokenBase(stream, state) { + var ch = stream.next(); + if (ch == '"' || ch == "'") + return chain(stream, state, jsTokenString(ch)); + else if (/[\[\]{}\(\),;\:\.]/.test(ch)) + return ret(ch); + else if (ch == "0" && stream.eat(/x/i)) { + stream.eatWhile(/[\da-f]/i); + return ret("number", "number"); + } + else if (/\d/.test(ch) || ch == "-" && stream.eat(/\d/)) { + stream.match(/^\d*(?:\.\d*)?(?:[eE][+\-]?\d+)?/); + return ret("number", "number"); + } + else if (ch == "/") { + if (stream.eat("*")) { + return chain(stream, state, jsTokenComment); + } + else if (stream.eat("/")) { + stream.skipToEnd(); + return ret("comment", "comment"); + } + else if (state.lastType == "operator" || state.lastType == "keyword c" || + /^[\[{}\(,;:]$/.test(state.lastType)) { + nextUntilUnescaped(stream, "/"); + stream.eatWhile(/[gimy]/); // 'y' is "sticky" option in Mozilla + return ret("regexp", "string-2"); + } + else { + stream.eatWhile(isOperatorChar); + return ret("operator", null, stream.current()); + } + } + else if (ch == "#") { + stream.skipToEnd(); + return ret("error", "error"); + } + else if (isOperatorChar.test(ch)) { + stream.eatWhile(isOperatorChar); + return ret("operator", null, stream.current()); + } + else { + stream.eatWhile(/[\w\$_]/); + var word = stream.current(), known = keywords.propertyIsEnumerable(word) && keywords[word]; + return (known && state.lastType != ".") ? ret(known.type, known.style, word) : + ret("variable", "variable", word); + } + } + + function jsTokenString(quote) { + return function(stream, state) { + if (!nextUntilUnescaped(stream, quote)) + state.tokenize = jsTokenBase; + return ret("string", "string"); + }; + } + + function jsTokenComment(stream, state) { + var maybeEnd = false, ch; + while (ch = stream.next()) { + if (ch == "/" && maybeEnd) { + state.tokenize = jsTokenBase; + break; + } + maybeEnd = (ch == "*"); + } + return ret("comment", "comment"); + } + + // Parser + + var atomicTypes = {"atom": true, "number": true, "variable": true, "string": true, "regexp": true, "this": true}; + + function JSLexical(indented, column, type, align, prev, info) { + this.indented = indented; + this.column = column; + this.type = type; + this.prev = prev; + this.info = info; + if (align != null) this.align = align; + } + + function inScope(state, varname) { + for (var v = state.localVars; v; v = v.next) + if (v.name == varname) return true; + } + + function parseJS(state, style, type, content, stream) { + var cc = state.cc; + // Communicate our context to the combinators. + // (Less wasteful than consing up a hundred closures on every call.) + cx.state = state; cx.stream = stream; cx.marked = null, cx.cc = cc; + + if (!state.lexical.hasOwnProperty("align")) + state.lexical.align = true; + + while(true) { + var combinator = cc.length ? cc.pop() : jsonMode ? expression : statement; + if (combinator(type, content)) { + while(cc.length && cc[cc.length - 1].lex) + cc.pop()(); + if (cx.marked) return cx.marked; + if (type == "variable" && inScope(state, content)) return "variable-2"; + return style; + } + } + } + + // Combinator utils + + var cx = {state: null, column: null, marked: null, cc: null}; + function pass() { + for (var i = arguments.length - 1; i >= 0; i--) cx.cc.push(arguments[i]); + } + function cont() { + pass.apply(null, arguments); + return true; + } + function register(varname) { + function inList(list) { + for (var v = list; v; v = v.next) + if (v.name == varname) return true; + return false; + } + var state = cx.state; + if (state.context) { + cx.marked = "def"; + if (inList(state.localVars)) return; + state.localVars = {name: varname, next: state.localVars}; + } else { + if (inList(state.globalVars)) return; + state.globalVars = {name: varname, next: state.globalVars}; + } + } + + // Combinators + + var defaultVars = {name: "this", next: {name: "arguments"}}; + function pushcontext() { + cx.state.context = {prev: cx.state.context, vars: cx.state.localVars}; + cx.state.localVars = defaultVars; + } + function popcontext() { + cx.state.localVars = cx.state.context.vars; + cx.state.context = cx.state.context.prev; + } + function pushlex(type, info) { + var result = function() { + var state = cx.state, indent = state.indented; + if (state.lexical.type == "stat") indent = state.lexical.indented; + state.lexical = new JSLexical(indent, cx.stream.column(), type, null, state.lexical, info); + }; + result.lex = true; + return result; + } + function poplex() { + var state = cx.state; + if (state.lexical.prev) { + if (state.lexical.type == ")") + state.indented = state.lexical.indented; + state.lexical = state.lexical.prev; + } + } + poplex.lex = true; + + function expect(wanted) { + return function(type) { + if (type == wanted) return cont(); + else if (wanted == ";") return pass(); + else return cont(arguments.callee); + }; + } + + function statement(type) { + if (type == "var") return cont(pushlex("vardef"), vardef1, expect(";"), poplex); + if (type == "keyword a") return cont(pushlex("form"), expression, statement, poplex); + if (type == "keyword b") return cont(pushlex("form"), statement, poplex); + if (type == "{") return cont(pushlex("}"), block, poplex); + if (type == ";") return cont(); + if (type == "if") return cont(pushlex("form"), expression, statement, poplex, maybeelse(cx.state.indented)); + if (type == "function") return cont(functiondef); + if (type == "for") return cont(pushlex("form"), expect("("), pushlex(")"), forspec1, expect(")"), + poplex, statement, poplex); + if (type == "variable") return cont(pushlex("stat"), maybelabel); + if (type == "switch") return cont(pushlex("form"), expression, pushlex("}", "switch"), expect("{"), + block, poplex, poplex); + if (type == "case") return cont(expression, expect(":")); + if (type == "default") return cont(expect(":")); + if (type == "catch") return cont(pushlex("form"), pushcontext, expect("("), funarg, expect(")"), + statement, poplex, popcontext); + return pass(pushlex("stat"), expression, expect(";"), poplex); + } + function expression(type) { + return expressionInner(type, false); + } + function expressionNoComma(type) { + return expressionInner(type, true); + } + function expressionInner(type, noComma) { + var maybeop = noComma ? maybeoperatorNoComma : maybeoperatorComma; + if (atomicTypes.hasOwnProperty(type)) return cont(maybeop); + if (type == "function") return cont(functiondef); + if (type == "keyword c") return cont(noComma ? maybeexpressionNoComma : maybeexpression); + if (type == "(") return cont(pushlex(")"), maybeexpression, expect(")"), poplex, maybeop); + if (type == "operator") return cont(noComma ? expressionNoComma : expression); + if (type == "[") return cont(pushlex("]"), commasep(expressionNoComma, "]"), poplex, maybeop); + if (type == "{") return cont(pushlex("}"), commasep(objprop, "}"), poplex, maybeop); + return cont(); + } + function maybeexpression(type) { + if (type.match(/[;\}\)\],]/)) return pass(); + return pass(expression); + } + function maybeexpressionNoComma(type) { + if (type.match(/[;\}\)\],]/)) return pass(); + return pass(expressionNoComma); + } + + function maybeoperatorComma(type, value) { + if (type == ",") return cont(expression); + return maybeoperatorNoComma(type, value, maybeoperatorComma); + } + function maybeoperatorNoComma(type, value, me) { + if (!me) me = maybeoperatorNoComma; + if (type == "operator") { + if (/\+\+|--/.test(value)) return cont(me); + if (value == "?") return cont(expression, expect(":"), expression); + return cont(expression); + } + if (type == ";") return; + if (type == "(") return cont(pushlex(")", "call"), commasep(expressionNoComma, ")"), poplex, me); + if (type == ".") return cont(property, me); + if (type == "[") return cont(pushlex("]"), expression, expect("]"), poplex, me); + } + function maybelabel(type) { + if (type == ":") return cont(poplex, statement); + return pass(maybeoperatorComma, expect(";"), poplex); + } + function property(type) { + if (type == "variable") {cx.marked = "property"; return cont();} + } + function objprop(type, value) { + if (type == "variable") { + cx.marked = "property"; + if (value == "get" || value == "set") return cont(getterSetter); + } else if (type == "number" || type == "string") { + cx.marked = type + " property"; + } + if (atomicTypes.hasOwnProperty(type)) return cont(expect(":"), expressionNoComma); + } + function getterSetter(type) { + if (type == ":") return cont(expression); + if (type != "variable") return cont(expect(":"), expression); + cx.marked = "property"; + return cont(functiondef); + } + function commasep(what, end) { + function proceed(type) { + if (type == ",") { + var lex = cx.state.lexical; + if (lex.info == "call") lex.pos = (lex.pos || 0) + 1; + return cont(what, proceed); + } + if (type == end) return cont(); + return cont(expect(end)); + } + return function(type) { + if (type == end) return cont(); + else return pass(what, proceed); + }; + } + function block(type) { + if (type == "}") return cont(); + return pass(statement, block); + } + function maybetype(type) { + if (type == ":") return cont(typedef); + return pass(); + } + function typedef(type) { + if (type == "variable"){cx.marked = "variable-3"; return cont();} + return pass(); + } + function vardef1(type, value) { + if (type == "variable") { + register(value); + return isTS ? cont(maybetype, vardef2) : cont(vardef2); + } + return pass(); + } + function vardef2(type, value) { + if (value == "=") return cont(expressionNoComma, vardef2); + if (type == ",") return cont(vardef1); + } + function maybeelse(indent) { + return function(type, value) { + if (type == "keyword b" && value == "else") { + cx.state.lexical = new JSLexical(indent, 0, "form", null, cx.state.lexical); + return cont(statement, poplex); + } + return pass(); + }; + } + function forspec1(type) { + if (type == "var") return cont(vardef1, expect(";"), forspec2); + if (type == ";") return cont(forspec2); + if (type == "variable") return cont(formaybein); + return pass(expression, expect(";"), forspec2); + } + function formaybein(_type, value) { + if (value == "in") return cont(expression); + return cont(maybeoperatorComma, forspec2); + } + function forspec2(type, value) { + if (type == ";") return cont(forspec3); + if (value == "in") return cont(expression); + return pass(expression, expect(";"), forspec3); + } + function forspec3(type) { + if (type != ")") cont(expression); + } + function functiondef(type, value) { + if (type == "variable") {register(value); return cont(functiondef);} + if (type == "(") return cont(pushlex(")"), pushcontext, commasep(funarg, ")"), poplex, statement, popcontext); + } + function funarg(type, value) { + if (type == "variable") {register(value); return isTS ? cont(maybetype) : cont();} + } + + // Interface + + return { + startState: function(basecolumn) { + return { + tokenize: jsTokenBase, + lastType: null, + cc: [], + lexical: new JSLexical((basecolumn || 0) - indentUnit, 0, "block", false), + localVars: parserConfig.localVars, + globalVars: parserConfig.globalVars, + context: parserConfig.localVars && {vars: parserConfig.localVars}, + indented: 0 + }; + }, + + token: function(stream, state) { + if (stream.sol()) { + if (!state.lexical.hasOwnProperty("align")) + state.lexical.align = false; + state.indented = stream.indentation(); + } + if (state.tokenize != jsTokenComment && stream.eatSpace()) return null; + var style = state.tokenize(stream, state); + if (type == "comment") return style; + state.lastType = type == "operator" && (content == "++" || content == "--") ? "incdec" : type; + return parseJS(state, style, type, content, stream); + }, + + indent: function(state, textAfter) { + if (state.tokenize == jsTokenComment) return CodeMirror.Pass; + if (state.tokenize != jsTokenBase) return 0; + var firstChar = textAfter && textAfter.charAt(0), lexical = state.lexical; + if (lexical.type == "stat" && firstChar == "}") lexical = lexical.prev; + if (statementIndent && lexical.type == ")" && lexical.prev.type == "stat") + lexical = lexical.prev; + var type = lexical.type, closing = firstChar == type; + + if (type == "vardef") return lexical.indented + (state.lastType == "operator" || state.lastType == "," ? 4 : 0); + else if (type == "form" && firstChar == "{") return lexical.indented; + else if (type == "form") return lexical.indented + indentUnit; + else if (type == "stat") + return lexical.indented + (state.lastType == "operator" || state.lastType == "," ? statementIndent || indentUnit : 0); + else if (lexical.info == "switch" && !closing && parserConfig.doubleIndentSwitch != false) + return lexical.indented + (/^(?:case|default)\b/.test(textAfter) ? indentUnit : 2 * indentUnit); + else if (lexical.align) return lexical.column + (closing ? 0 : 1); + else return lexical.indented + (closing ? 0 : indentUnit); + }, + + electricChars: ":{}", + blockCommentStart: jsonMode ? null : "/*", + blockCommentEnd: jsonMode ? null : "*/", + lineComment: jsonMode ? null : "//", + + jsonMode: jsonMode + }; +}); + +CodeMirror.defineMIME("text/javascript", "javascript"); +CodeMirror.defineMIME("text/ecmascript", "javascript"); +CodeMirror.defineMIME("application/javascript", "javascript"); +CodeMirror.defineMIME("application/ecmascript", "javascript"); +CodeMirror.defineMIME("application/json", {name: "javascript", json: true}); +CodeMirror.defineMIME("application/x-json", {name: "javascript", json: true}); +CodeMirror.defineMIME("text/typescript", { name: "javascript", typescript: true }); +CodeMirror.defineMIME("application/typescript", { name: "javascript", typescript: true }); diff --git a/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/javascript/typescript.html b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/javascript/typescript.html new file mode 100644 index 000000000..58315e7ac --- /dev/null +++ b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/javascript/typescript.html @@ -0,0 +1,48 @@ + + + + + CodeMirror: TypeScript mode + + + + + + + +

CodeMirror: TypeScript mode

+ +
+ + + +

This is a specialization of the JavaScript mode.

+ + diff --git a/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/jinja2/index.html b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/jinja2/index.html new file mode 100644 index 000000000..7cd1da233 --- /dev/null +++ b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/jinja2/index.html @@ -0,0 +1,38 @@ + + + + + CodeMirror: Jinja2 mode + + + + + + + +

CodeMirror: Jinja2 mode

+
+ + + diff --git a/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/jinja2/jinja2.js b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/jinja2/jinja2.js new file mode 100644 index 000000000..16b06c48e --- /dev/null +++ b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/jinja2/jinja2.js @@ -0,0 +1,42 @@ +CodeMirror.defineMode("jinja2", function() { + var keywords = ["block", "endblock", "for", "endfor", "in", "true", "false", + "loop", "none", "self", "super", "if", "as", "not", "and", + "else", "import", "with", "without", "context"]; + keywords = new RegExp("^((" + keywords.join(")|(") + "))\\b"); + + function tokenBase (stream, state) { + var ch = stream.next(); + if (ch == "{") { + if (ch = stream.eat(/\{|%|#/)) { + stream.eat("-"); + state.tokenize = inTag(ch); + return "tag"; + } + } + } + function inTag (close) { + if (close == "{") { + close = "}"; + } + return function (stream, state) { + var ch = stream.next(); + if ((ch == close || (ch == "-" && stream.eat(close))) + && stream.eat("}")) { + state.tokenize = tokenBase; + return "tag"; + } + if (stream.match(keywords)) { + return "keyword"; + } + return close == "#" ? "comment" : "string"; + }; + } + return { + startState: function () { + return {tokenize: tokenBase}; + }, + token: function (stream, state) { + return state.tokenize(stream, state); + } + }; +}); diff --git a/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/less/index.html b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/less/index.html new file mode 100644 index 000000000..78c1e5307 --- /dev/null +++ b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/less/index.html @@ -0,0 +1,741 @@ + + + + + CodeMirror: LESS mode + + + + + + + + + +

CodeMirror: LESS mode

+
+ + +

MIME types defined: text/x-less, text/css (if not previously defined).

+ + diff --git a/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/less/less.js b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/less/less.js new file mode 100644 index 000000000..09f510e03 --- /dev/null +++ b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/less/less.js @@ -0,0 +1,258 @@ +/* + LESS mode - http://www.lesscss.org/ + Ported to CodeMirror by Peter Kroon + Report bugs/issues here: https://github.com/marijnh/CodeMirror/issues GitHub: @peterkroon +*/ + +CodeMirror.defineMode("less", function(config) { + var indentUnit = config.indentUnit, type; + function ret(style, tp) {type = tp; return style;} + + var selectors = /(^\:root$|^\:nth\-child$|^\:nth\-last\-child$|^\:nth\-of\-type$|^\:nth\-last\-of\-type$|^\:first\-child$|^\:last\-child$|^\:first\-of\-type$|^\:last\-of\-type$|^\:only\-child$|^\:only\-of\-type$|^\:empty$|^\:link|^\:visited$|^\:active$|^\:hover$|^\:focus$|^\:target$|^\:lang$|^\:enabled^\:disabled$|^\:checked$|^\:first\-line$|^\:first\-letter$|^\:before$|^\:after$|^\:not$|^\:required$|^\:invalid$)/; + + function tokenBase(stream, state) { + var ch = stream.next(); + + if (ch == "@") {stream.eatWhile(/[\w\-]/); return ret("meta", stream.current());} + else if (ch == "/" && stream.eat("*")) { + state.tokenize = tokenCComment; + return tokenCComment(stream, state); + } + else if (ch == "<" && stream.eat("!")) { + state.tokenize = tokenSGMLComment; + return tokenSGMLComment(stream, state); + } + else if (ch == "=") ret(null, "compare"); + else if (ch == "|" && stream.eat("=")) return ret(null, "compare"); + else if (ch == "\"" || ch == "'") { + state.tokenize = tokenString(ch); + return state.tokenize(stream, state); + } + else if (ch == "/") { // e.g.: .png will not be parsed as a class + if(stream.eat("/")){ + state.tokenize = tokenSComment; + return tokenSComment(stream, state); + }else{ + if(type == "string" || type == "(")return ret("string", "string"); + if(state.stack[state.stack.length-1] != undefined)return ret(null, ch); + stream.eatWhile(/[\a-zA-Z0-9\-_.\s]/); + if( /\/|\)|#/.test(stream.peek() || (stream.eatSpace() && stream.peek() == ")")) || stream.eol() )return ret("string", "string"); // let url(/images/logo.png) without quotes return as string + } + } + else if (ch == "!") { + stream.match(/^\s*\w*/); + return ret("keyword", "important"); + } + else if (/\d/.test(ch)) { + stream.eatWhile(/[\w.%]/); + return ret("number", "unit"); + } + else if (/[,+<>*\/]/.test(ch)) { + if(stream.peek() == "=" || type == "a")return ret("string", "string"); + return ret(null, "select-op"); + } + else if (/[;{}:\[\]()~\|]/.test(ch)) { + if(ch == ":"){ + stream.eatWhile(/[a-z\\\-]/); + if( selectors.test(stream.current()) ){ + return ret("tag", "tag"); + }else if(stream.peek() == ":"){//::-webkit-search-decoration + stream.next(); + stream.eatWhile(/[a-z\\\-]/); + if(stream.current().match(/\:\:\-(o|ms|moz|webkit)\-/))return ret("string", "string"); + if( selectors.test(stream.current().substring(1)) )return ret("tag", "tag"); + return ret(null, ch); + }else{ + return ret(null, ch); + } + }else if(ch == "~"){ + if(type == "r")return ret("string", "string"); + }else{ + return ret(null, ch); + } + } + else if (ch == ".") { + if(type == "(" || type == "string")return ret("string", "string"); // allow url(../image.png) + stream.eatWhile(/[\a-zA-Z0-9\-_]/); + if(stream.peek() == " ")stream.eatSpace(); + if(stream.peek() == ")")return ret("number", "unit");//rgba(0,0,0,.25); + return ret("tag", "tag"); + } + else if (ch == "#") { + //we don't eat white-space, we want the hex color and or id only + stream.eatWhile(/[A-Za-z0-9]/); + //check if there is a proper hex color length e.g. #eee || #eeeEEE + if(stream.current().length == 4 || stream.current().length == 7){ + if(stream.current().match(/[A-Fa-f0-9]{6}|[A-Fa-f0-9]{3}/,false) != null){//is there a valid hex color value present in the current stream + //when not a valid hex value, parse as id + if(stream.current().substring(1) != stream.current().match(/[A-Fa-f0-9]{6}|[A-Fa-f0-9]{3}/,false))return ret("atom", "tag"); + //eat white-space + stream.eatSpace(); + //when hex value declaration doesn't end with [;,] but is does with a slash/cc comment treat it as an id, just like the other hex values that don't end with[;,] + if( /[\/<>.(){!$%^&*_\-\\?=+\|#'~`]/.test(stream.peek()) )return ret("atom", "tag"); + //#time { color: #aaa } + else if(stream.peek() == "}" )return ret("number", "unit"); + //we have a valid hex color value, parse as id whenever an element/class is defined after the hex(id) value e.g. #eee aaa || #eee .aaa + else if( /[a-zA-Z\\]/.test(stream.peek()) )return ret("atom", "tag"); + //when a hex value is on the end of a line, parse as id + else if(stream.eol())return ret("atom", "tag"); + //default + else return ret("number", "unit"); + }else{//when not a valid hexvalue in the current stream e.g. #footer + stream.eatWhile(/[\w\\\-]/); + return ret("atom", "tag"); + } + }else{//when not a valid hexvalue length + stream.eatWhile(/[\w\\\-]/); + return ret("atom", "tag"); + } + } + else if (ch == "&") { + stream.eatWhile(/[\w\-]/); + return ret(null, ch); + } + else { + stream.eatWhile(/[\w\\\-_%.{]/); + if(type == "string"){ + return ret("string", "string"); + }else if(stream.current().match(/(^http$|^https$)/) != null){ + stream.eatWhile(/[\w\\\-_%.{:\/]/); + return ret("string", "string"); + }else if(stream.peek() == "<" || stream.peek() == ">"){ + return ret("tag", "tag"); + }else if( /\(/.test(stream.peek()) ){ + return ret(null, ch); + }else if (stream.peek() == "/" && state.stack[state.stack.length-1] != undefined){ // url(dir/center/image.png) + return ret("string", "string"); + }else if( stream.current().match(/\-\d|\-.\d/) ){ // match e.g.: -5px -0.4 etc... only colorize the minus sign + //commment out these 2 comment if you want the minus sign to be parsed as null -500px + //stream.backUp(stream.current().length-1); + //return ret(null, ch); //console.log( stream.current() ); + return ret("number", "unit"); + }else if( /\/|[\s\)]/.test(stream.peek() || stream.eol() || (stream.eatSpace() && stream.peek() == "/")) && stream.current().indexOf(".") !== -1){ + if(stream.current().substring(stream.current().length-1,stream.current().length) == "{"){ + stream.backUp(1); + return ret("tag", "tag"); + }//end if + stream.eatSpace(); + if( /[{<>.a-zA-Z\/]/.test(stream.peek()) || stream.eol() )return ret("tag", "tag"); // e.g. button.icon-plus + return ret("string", "string"); // let url(/images/logo.png) without quotes return as string + }else if( stream.eol() || stream.peek() == "[" || stream.peek() == "#" || type == "tag" ){ + if(stream.current().substring(stream.current().length-1,stream.current().length) == "{")stream.backUp(1); + return ret("tag", "tag"); + }else if(type == "compare" || type == "a" || type == "("){ + return ret("string", "string"); + }else if(type == "|" || stream.current() == "-" || type == "["){ + return ret(null, ch); + }else if(stream.peek() == ":") { + stream.next(); + var t_v = stream.peek() == ":" ? true : false; + if(!t_v){ + var old_pos = stream.pos; + var sc = stream.current().length; + stream.eatWhile(/[a-z\\\-]/); + var new_pos = stream.pos; + if(stream.current().substring(sc-1).match(selectors) != null){ + stream.backUp(new_pos-(old_pos-1)); + return ret("tag", "tag"); + } else stream.backUp(new_pos-(old_pos-1)); + }else{ + stream.backUp(1); + } + if(t_v)return ret("tag", "tag"); else return ret("variable", "variable"); + }else{ + return ret("variable", "variable"); + } + } + } + + function tokenSComment(stream, state) { // SComment = Slash comment + stream.skipToEnd(); + state.tokenize = tokenBase; + return ret("comment", "comment"); + } + + function tokenCComment(stream, state) { + var maybeEnd = false, ch; + while ((ch = stream.next()) != null) { + if (maybeEnd && ch == "/") { + state.tokenize = tokenBase; + break; + } + maybeEnd = (ch == "*"); + } + return ret("comment", "comment"); + } + + function tokenSGMLComment(stream, state) { + var dashes = 0, ch; + while ((ch = stream.next()) != null) { + if (dashes >= 2 && ch == ">") { + state.tokenize = tokenBase; + break; + } + dashes = (ch == "-") ? dashes + 1 : 0; + } + return ret("comment", "comment"); + } + + function tokenString(quote) { + return function(stream, state) { + var escaped = false, ch; + while ((ch = stream.next()) != null) { + if (ch == quote && !escaped) + break; + escaped = !escaped && ch == "\\"; + } + if (!escaped) state.tokenize = tokenBase; + return ret("string", "string"); + }; + } + + return { + startState: function(base) { + return {tokenize: tokenBase, + baseIndent: base || 0, + stack: []}; + }, + + token: function(stream, state) { + if (stream.eatSpace()) return null; + var style = state.tokenize(stream, state); + + var context = state.stack[state.stack.length-1]; + if (type == "hash" && context == "rule") style = "atom"; + else if (style == "variable") { + if (context == "rule") style = null; //"tag" + else if (!context || context == "@media{") { + style = stream.current() == "when" ? "variable" : + /[\s,|\s\)|\s]/.test(stream.peek()) ? "tag" : type; + } + } + + if (context == "rule" && /^[\{\};]$/.test(type)) + state.stack.pop(); + if (type == "{") { + if (context == "@media") state.stack[state.stack.length-1] = "@media{"; + else state.stack.push("{"); + } + else if (type == "}") state.stack.pop(); + else if (type == "@media") state.stack.push("@media"); + else if (context == "{" && type != "comment") state.stack.push("rule"); + return style; + }, + + indent: function(state, textAfter) { + var n = state.stack.length; + if (/^\}/.test(textAfter)) + n -= state.stack[state.stack.length-1] == "rule" ? 2 : 1; + return state.baseIndent + n * indentUnit; + }, + + electricChars: "}" + }; +}); + +CodeMirror.defineMIME("text/x-less", "less"); +if (!CodeMirror.mimeModes.hasOwnProperty("text/css")) + CodeMirror.defineMIME("text/css", "less"); diff --git a/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/livescript/LICENSE b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/livescript/LICENSE new file mode 100644 index 000000000..a675c4023 --- /dev/null +++ b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/livescript/LICENSE @@ -0,0 +1,23 @@ +The MIT License + +Copyright (c) 2013 Kenneth Bentley +Modified from the CoffeeScript CodeMirror mode, Copyright (c) 2011 Jeff Pickhardt +Modified from the Python CodeMirror mode, 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. diff --git a/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/livescript/index.html b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/livescript/index.html new file mode 100644 index 000000000..3054e35b0 --- /dev/null +++ b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/livescript/index.html @@ -0,0 +1,446 @@ + + + + CodeMirror: LiveScript mode + + + + + + + + +

CodeMirror: LiveScript mode

+
+ + +

MIME types defined: text/x-livescript.

+ +

The LiveScript mode was written by Kenneth Bentley (license).

+ + + diff --git a/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/livescript/livescript.js b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/livescript/livescript.js new file mode 100644 index 000000000..c000324b8 --- /dev/null +++ b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/livescript/livescript.js @@ -0,0 +1,267 @@ +/** + * Link to the project's GitHub page: + * https://github.com/duralog/CodeMirror + */ +(function() { + CodeMirror.defineMode('livescript', function(){ + var tokenBase, external; + tokenBase = function(stream, state){ + var next_rule, nr, i$, len$, r, m; + if (next_rule = state.next || 'start') { + state.next = state.next; + if (Array.isArray(nr = Rules[next_rule])) { + for (i$ = 0, len$ = nr.length; i$ < len$; ++i$) { + r = nr[i$]; + if (r.regex && (m = stream.match(r.regex))) { + state.next = r.next; + return r.token; + } + } + stream.next(); + return 'error'; + } + if (stream.match(r = Rules[next_rule])) { + if (r.regex && stream.match(r.regex)) { + state.next = r.next; + return r.token; + } else { + stream.next(); + return 'error'; + } + } + } + stream.next(); + return 'error'; + }; + external = { + startState: function(){ + return { + next: 'start', + lastToken: null + }; + }, + token: function(stream, state){ + var style; + style = tokenBase(stream, state); + state.lastToken = { + style: style, + indent: stream.indentation(), + content: stream.current() + }; + return style.replace(/\./g, ' '); + }, + indent: function(state){ + var indentation; + indentation = state.lastToken.indent; + if (state.lastToken.content.match(indenter)) { + indentation += 2; + } + return indentation; + } + }; + return external; + }); + + var identifier = '(?![\\d\\s])[$\\w\\xAA-\\uFFDC](?:(?!\\s)[$\\w\\xAA-\\uFFDC]|-[A-Za-z])*'; + var indenter = RegExp('(?:[({[=:]|[-~]>|\\b(?:e(?:lse|xport)|d(?:o|efault)|t(?:ry|hen)|finally|import(?:\\s*all)?|const|var|let|new|catch(?:\\s*' + identifier + ')?))\\s*$'); + var keywordend = '(?![$\\w]|-[A-Za-z]|\\s*:(?![:=]))'; + var stringfill = { + token: 'string', + regex: '.+' + }; + var Rules = { + start: [ + { + token: 'comment.doc', + regex: '/\\*', + next: 'comment' + }, { + token: 'comment', + regex: '#.*' + }, { + token: 'keyword', + regex: '(?:t(?:h(?:is|row|en)|ry|ypeof!?)|c(?:on(?:tinue|st)|a(?:se|tch)|lass)|i(?:n(?:stanceof)?|mp(?:ort(?:\\s+all)?|lements)|[fs])|d(?:e(?:fault|lete|bugger)|o)|f(?:or(?:\\s+own)?|inally|unction)|s(?:uper|witch)|e(?:lse|x(?:tends|port)|val)|a(?:nd|rguments)|n(?:ew|ot)|un(?:less|til)|w(?:hile|ith)|o[fr]|return|break|let|var|loop)' + keywordend + }, { + token: 'constant.language', + regex: '(?:true|false|yes|no|on|off|null|void|undefined)' + keywordend + }, { + token: 'invalid.illegal', + regex: '(?:p(?:ackage|r(?:ivate|otected)|ublic)|i(?:mplements|nterface)|enum|static|yield)' + keywordend + }, { + token: 'language.support.class', + regex: '(?:R(?:e(?:gExp|ferenceError)|angeError)|S(?:tring|yntaxError)|E(?:rror|valError)|Array|Boolean|Date|Function|Number|Object|TypeError|URIError)' + keywordend + }, { + token: 'language.support.function', + regex: '(?:is(?:NaN|Finite)|parse(?:Int|Float)|Math|JSON|(?:en|de)codeURI(?:Component)?)' + keywordend + }, { + token: 'variable.language', + regex: '(?:t(?:hat|il|o)|f(?:rom|allthrough)|it|by|e)' + keywordend + }, { + token: 'identifier', + regex: identifier + '\\s*:(?![:=])' + }, { + token: 'variable', + regex: identifier + }, { + token: 'keyword.operator', + regex: '(?:\\.{3}|\\s+\\?)' + }, { + token: 'keyword.variable', + regex: '(?:@+|::|\\.\\.)', + next: 'key' + }, { + token: 'keyword.operator', + regex: '\\.\\s*', + next: 'key' + }, { + token: 'string', + regex: '\\\\\\S[^\\s,;)}\\]]*' + }, { + token: 'string.doc', + regex: '\'\'\'', + next: 'qdoc' + }, { + token: 'string.doc', + regex: '"""', + next: 'qqdoc' + }, { + token: 'string', + regex: '\'', + next: 'qstring' + }, { + token: 'string', + regex: '"', + next: 'qqstring' + }, { + token: 'string', + regex: '`', + next: 'js' + }, { + token: 'string', + regex: '<\\[', + next: 'words' + }, { + token: 'string.regex', + regex: '//', + next: 'heregex' + }, { + token: 'string.regex', + regex: '\\/(?:[^[\\/\\n\\\\]*(?:(?:\\\\.|\\[[^\\]\\n\\\\]*(?:\\\\.[^\\]\\n\\\\]*)*\\])[^[\\/\\n\\\\]*)*)\\/[gimy$]{0,4}', + next: 'key' + }, { + token: 'constant.numeric', + regex: '(?:0x[\\da-fA-F][\\da-fA-F_]*|(?:[2-9]|[12]\\d|3[0-6])r[\\da-zA-Z][\\da-zA-Z_]*|(?:\\d[\\d_]*(?:\\.\\d[\\d_]*)?|\\.\\d[\\d_]*)(?:e[+-]?\\d[\\d_]*)?[\\w$]*)' + }, { + token: 'lparen', + regex: '[({[]' + }, { + token: 'rparen', + regex: '[)}\\]]', + next: 'key' + }, { + token: 'keyword.operator', + regex: '\\S+' + }, { + token: 'text', + regex: '\\s+' + } + ], + heregex: [ + { + token: 'string.regex', + regex: '.*?//[gimy$?]{0,4}', + next: 'start' + }, { + token: 'string.regex', + regex: '\\s*#{' + }, { + token: 'comment.regex', + regex: '\\s+(?:#.*)?' + }, { + token: 'string.regex', + regex: '\\S+' + } + ], + key: [ + { + token: 'keyword.operator', + regex: '[.?@!]+' + }, { + token: 'identifier', + regex: identifier, + next: 'start' + }, { + token: 'text', + regex: '.', + next: 'start' + } + ], + comment: [ + { + token: 'comment.doc', + regex: '.*?\\*/', + next: 'start' + }, { + token: 'comment.doc', + regex: '.+' + } + ], + qdoc: [ + { + token: 'string', + regex: ".*?'''", + next: 'key' + }, stringfill + ], + qqdoc: [ + { + token: 'string', + regex: '.*?"""', + next: 'key' + }, stringfill + ], + qstring: [ + { + token: 'string', + regex: '[^\\\\\']*(?:\\\\.[^\\\\\']*)*\'', + next: 'key' + }, stringfill + ], + qqstring: [ + { + token: 'string', + regex: '[^\\\\"]*(?:\\\\.[^\\\\"]*)*"', + next: 'key' + }, stringfill + ], + js: [ + { + token: 'string', + regex: '[^\\\\`]*(?:\\\\.[^\\\\`]*)*`', + next: 'key' + }, stringfill + ], + words: [ + { + token: 'string', + regex: '.*?\\]>', + next: 'key' + }, stringfill + ] + }; + for (var idx in Rules) { + var r = Rules[idx]; + if (Array.isArray(r)) { + for (var i = 0, len = r.length; i < len; ++i) { + var rr = r[i]; + if (rr.regex) { + Rules[idx][i].regex = new RegExp('^' + rr.regex); + } + } + } else if (r.regex) { + Rules[idx].regex = new RegExp('^' + r.regex); + } + } +})(); + +CodeMirror.defineMIME('text/x-livescript', 'livescript'); diff --git a/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/livescript/livescript.ls b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/livescript/livescript.ls new file mode 100644 index 000000000..065242312 --- /dev/null +++ b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/livescript/livescript.ls @@ -0,0 +1,266 @@ +/** + * Link to the project's GitHub page: + * https://github.com/duralog/CodeMirror + */ +CodeMirror.defineMode 'livescript', (conf) -> + tokenBase = (stream, state) -> + #indent = + if next_rule = state.next or \start + state.next = state.next + if Array.isArray nr = Rules[next_rule] + for r in nr + if r.regex and m = stream.match r.regex + state.next = r.next + return r.token + stream.next! + return \error + if stream.match r = Rules[next_rule] + if r.regex and stream.match r.regex + state.next = r.next + return r.token + else + stream.next! + return \error + stream.next! + return 'error' + external = { + startState: (basecolumn) -> + { + next: \start + lastToken: null + } + token: (stream, state) -> + style = tokenBase stream, state #tokenLexer stream, state + state.lastToken = { + style: style + indent: stream.indentation! + content: stream.current! + } + style.replace /\./g, ' ' + indent: (state, textAfter) -> + # XXX this won't work with backcalls + indentation = state.lastToken.indent + if state.lastToken.content.match indenter then indentation += 2 + return indentation + } + external + +### Highlight Rules +# taken from mode-ls.ls + +indenter = // (? + : [({[=:] + | [-~]> + | \b (?: e(?:lse|xport) | d(?:o|efault) | t(?:ry|hen) | finally | + import (?:\s* all)? | const | var | + let | new | catch (?:\s* #identifier)? ) + ) \s* $ // + +identifier = /(?![\d\s])[$\w\xAA-\uFFDC](?:(?!\s)[$\w\xAA-\uFFDC]|-[A-Za-z])*/$ +keywordend = /(?![$\w]|-[A-Za-z]|\s*:(?![:=]))/$ +stringfill = token: \string, regex: '.+' + +Rules = + start: + * token: \comment.doc + regex: '/\\*' + next : \comment + + * token: \comment + regex: '#.*' + + * token: \keyword + regex: //(? + :t(?:h(?:is|row|en)|ry|ypeof!?) + |c(?:on(?:tinue|st)|a(?:se|tch)|lass) + |i(?:n(?:stanceof)?|mp(?:ort(?:\s+all)?|lements)|[fs]) + |d(?:e(?:fault|lete|bugger)|o) + |f(?:or(?:\s+own)?|inally|unction) + |s(?:uper|witch) + |e(?:lse|x(?:tends|port)|val) + |a(?:nd|rguments) + |n(?:ew|ot) + |un(?:less|til) + |w(?:hile|ith) + |o[fr]|return|break|let|var|loop + )//$ + keywordend + + * token: \constant.language + regex: '(?:true|false|yes|no|on|off|null|void|undefined)' + keywordend + + * token: \invalid.illegal + regex: '(? + :p(?:ackage|r(?:ivate|otected)|ublic) + |i(?:mplements|nterface) + |enum|static|yield + )' + keywordend + + * token: \language.support.class + regex: '(? + :R(?:e(?:gExp|ferenceError)|angeError) + |S(?:tring|yntaxError) + |E(?:rror|valError) + |Array|Boolean|Date|Function|Number|Object|TypeError|URIError + )' + keywordend + + * token: \language.support.function + regex: '(? + :is(?:NaN|Finite) + |parse(?:Int|Float) + |Math|JSON + |(?:en|de)codeURI(?:Component)? + )' + keywordend + + * token: \variable.language + regex: '(?:t(?:hat|il|o)|f(?:rom|allthrough)|it|by|e)' + keywordend + + * token: \identifier + regex: identifier + /\s*:(?![:=])/$ + + * token: \variable + regex: identifier + + * token: \keyword.operator + regex: /(?:\.{3}|\s+\?)/$ + + * token: \keyword.variable + regex: /(?:@+|::|\.\.)/$ + next : \key + + * token: \keyword.operator + regex: /\.\s*/$ + next : \key + + * token: \string + regex: /\\\S[^\s,;)}\]]*/$ + + * token: \string.doc + regex: \''' + next : \qdoc + + * token: \string.doc + regex: \""" + next : \qqdoc + + * token: \string + regex: \' + next : \qstring + + * token: \string + regex: \" + next : \qqstring + + * token: \string + regex: \` + next : \js + + * token: \string + regex: '<\\[' + next : \words + + * token: \string.regex + regex: \// + next : \heregex + + * token: \string.regex + regex: // + /(?: [^ [ / \n \\ ]* + (?: (?: \\. + | \[ [^\]\n\\]* (?:\\.[^\]\n\\]*)* \] + ) [^ [ / \n \\ ]* + )* + )/ [gimy$]{0,4} + //$ + next : \key + + * token: \constant.numeric + regex: '(?:0x[\\da-fA-F][\\da-fA-F_]* + |(?:[2-9]|[12]\\d|3[0-6])r[\\da-zA-Z][\\da-zA-Z_]* + |(?:\\d[\\d_]*(?:\\.\\d[\\d_]*)?|\\.\\d[\\d_]*) + (?:e[+-]?\\d[\\d_]*)?[\\w$]*)' + + * token: \lparen + regex: '[({[]' + + * token: \rparen + regex: '[)}\\]]' + next : \key + + * token: \keyword.operator + regex: \\\S+ + + * token: \text + regex: \\\s+ + + heregex: + * token: \string.regex + regex: '.*?//[gimy$?]{0,4}' + next : \start + * token: \string.regex + regex: '\\s*#{' + * token: \comment.regex + regex: '\\s+(?:#.*)?' + * token: \string.regex + regex: '\\S+' + + key: + * token: \keyword.operator + regex: '[.?@!]+' + * token: \identifier + regex: identifier + next : \start + * token: \text + regex: '.' + next : \start + + comment: + * token: \comment.doc + regex: '.*?\\*/' + next : \start + * token: \comment.doc + regex: '.+' + + qdoc: + token: \string + regex: ".*?'''" + next : \key + stringfill + + qqdoc: + token: \string + regex: '.*?"""' + next : \key + stringfill + + qstring: + token: \string + regex: /[^\\']*(?:\\.[^\\']*)*'/$ + next : \key + stringfill + + qqstring: + token: \string + regex: /[^\\"]*(?:\\.[^\\"]*)*"/$ + next : \key + stringfill + + js: + token: \string + regex: /[^\\`]*(?:\\.[^\\`]*)*`/$ + next : \key + stringfill + + words: + token: \string + regex: '.*?\\]>' + next : \key + stringfill + +# for optimization, precompile the regexps +for idx, r of Rules + if Array.isArray r + for rr, i in r + if rr.regex then Rules[idx][i].regex = new RegExp '^'+rr.regex + else if r.regex then Rules[idx].regex = new RegExp '^'+r.regex + +CodeMirror.defineMIME 'text/x-livescript', 'livescript' diff --git a/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/lua/index.html b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/lua/index.html new file mode 100644 index 000000000..a0a42d91c --- /dev/null +++ b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/lua/index.html @@ -0,0 +1,74 @@ + + + + + CodeMirror: Lua mode + + + + + + + + + +

CodeMirror: Lua mode

+
+ + +

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.

+

MIME types defined: text/x-lua.

+ + + diff --git a/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/lua/lua.js b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/lua/lua.js new file mode 100644 index 000000000..b8deaa257 --- /dev/null +++ b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/lua/lua.js @@ -0,0 +1,144 @@ +// LUA mode. Ported to CodeMirror 2 from Franciszek Wawrzak's +// CodeMirror 1 mode. +// highlights keywords, strings, comments (no leveling supported! ("[==[")), tokens, basic indenting + +CodeMirror.defineMode("lua", function(config, parserConfig) { + var indentUnit = config.indentUnit; + + function prefixRE(words) { + return new RegExp("^(?:" + words.join("|") + ")", "i"); + } + function wordRE(words) { + return new RegExp("^(?:" + words.join("|") + ")$", "i"); + } + var specials = wordRE(parserConfig.specials || []); + + // long list of standard functions from lua manual + var builtins = wordRE([ + "_G","_VERSION","assert","collectgarbage","dofile","error","getfenv","getmetatable","ipairs","load", + "loadfile","loadstring","module","next","pairs","pcall","print","rawequal","rawget","rawset","require", + "select","setfenv","setmetatable","tonumber","tostring","type","unpack","xpcall", + + "coroutine.create","coroutine.resume","coroutine.running","coroutine.status","coroutine.wrap","coroutine.yield", + + "debug.debug","debug.getfenv","debug.gethook","debug.getinfo","debug.getlocal","debug.getmetatable", + "debug.getregistry","debug.getupvalue","debug.setfenv","debug.sethook","debug.setlocal","debug.setmetatable", + "debug.setupvalue","debug.traceback", + + "close","flush","lines","read","seek","setvbuf","write", + + "io.close","io.flush","io.input","io.lines","io.open","io.output","io.popen","io.read","io.stderr","io.stdin", + "io.stdout","io.tmpfile","io.type","io.write", + + "math.abs","math.acos","math.asin","math.atan","math.atan2","math.ceil","math.cos","math.cosh","math.deg", + "math.exp","math.floor","math.fmod","math.frexp","math.huge","math.ldexp","math.log","math.log10","math.max", + "math.min","math.modf","math.pi","math.pow","math.rad","math.random","math.randomseed","math.sin","math.sinh", + "math.sqrt","math.tan","math.tanh", + + "os.clock","os.date","os.difftime","os.execute","os.exit","os.getenv","os.remove","os.rename","os.setlocale", + "os.time","os.tmpname", + + "package.cpath","package.loaded","package.loaders","package.loadlib","package.path","package.preload", + "package.seeall", + + "string.byte","string.char","string.dump","string.find","string.format","string.gmatch","string.gsub", + "string.len","string.lower","string.match","string.rep","string.reverse","string.sub","string.upper", + + "table.concat","table.insert","table.maxn","table.remove","table.sort" + ]); + var keywords = wordRE(["and","break","elseif","false","nil","not","or","return", + "true","function", "end", "if", "then", "else", "do", + "while", "repeat", "until", "for", "in", "local" ]); + + var indentTokens = wordRE(["function", "if","repeat","do", "\\(", "{"]); + var dedentTokens = wordRE(["end", "until", "\\)", "}"]); + var dedentPartial = prefixRE(["end", "until", "\\)", "}", "else", "elseif"]); + + function readBracket(stream) { + var level = 0; + while (stream.eat("=")) ++level; + stream.eat("["); + return level; + } + + function normal(stream, state) { + var ch = stream.next(); + if (ch == "-" && stream.eat("-")) { + if (stream.eat("[") && stream.eat("[")) + return (state.cur = bracketed(readBracket(stream), "comment"))(stream, state); + stream.skipToEnd(); + return "comment"; + } + if (ch == "\"" || ch == "'") + return (state.cur = string(ch))(stream, state); + if (ch == "[" && /[\[=]/.test(stream.peek())) + return (state.cur = bracketed(readBracket(stream), "string"))(stream, state); + if (/\d/.test(ch)) { + stream.eatWhile(/[\w.%]/); + return "number"; + } + if (/[\w_]/.test(ch)) { + stream.eatWhile(/[\w\\\-_.]/); + return "variable"; + } + return null; + } + + function bracketed(level, style) { + return function(stream, state) { + var curlev = null, ch; + while ((ch = stream.next()) != null) { + if (curlev == null) {if (ch == "]") curlev = 0;} + else if (ch == "=") ++curlev; + else if (ch == "]" && curlev == level) { state.cur = normal; break; } + else curlev = null; + } + return style; + }; + } + + function string(quote) { + return function(stream, state) { + var escaped = false, ch; + while ((ch = stream.next()) != null) { + if (ch == quote && !escaped) break; + escaped = !escaped && ch == "\\"; + } + if (!escaped) state.cur = normal; + return "string"; + }; + } + + return { + startState: function(basecol) { + return {basecol: basecol || 0, indentDepth: 0, cur: normal}; + }, + + token: function(stream, state) { + if (stream.eatSpace()) return null; + var style = state.cur(stream, state); + var word = stream.current(); + if (style == "variable") { + if (keywords.test(word)) style = "keyword"; + else if (builtins.test(word)) style = "builtin"; + else if (specials.test(word)) style = "variable-2"; + } + if ((style != "comment") && (style != "string")){ + if (indentTokens.test(word)) ++state.indentDepth; + else if (dedentTokens.test(word)) --state.indentDepth; + } + return style; + }, + + indent: function(state, textAfter) { + var closing = dedentPartial.test(textAfter); + return state.basecol + indentUnit * (state.indentDepth - (closing ? 1 : 0)); + }, + + lineComment: "--", + blockCommentStart: "--[[", + blockCommentEnd: "]]" + }; +}); + +CodeMirror.defineMIME("text/x-lua", "lua"); diff --git a/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/markdown/index.html b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/markdown/index.html new file mode 100644 index 000000000..6f97b10e7 --- /dev/null +++ b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/markdown/index.html @@ -0,0 +1,344 @@ + + + + + CodeMirror: Markdown mode + + + + + + + + + +

CodeMirror: Markdown mode

+ + +
+ + + +

Optionally depends on the XML mode for properly highlighted inline XML blocks.

+ +

MIME types defined: text/x-markdown.

+ +

Parsing/Highlighting Tests: normal, verbose.

+ + + diff --git a/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/markdown/markdown.js b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/markdown/markdown.js new file mode 100644 index 000000000..72b0d6ced --- /dev/null +++ b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/markdown/markdown.js @@ -0,0 +1,526 @@ +CodeMirror.defineMode("markdown", function(cmCfg, modeCfg) { + + var htmlFound = CodeMirror.modes.hasOwnProperty("xml"); + var htmlMode = CodeMirror.getMode(cmCfg, htmlFound ? {name: "xml", htmlMode: true} : "text/plain"); + var aliases = { + html: "htmlmixed", + js: "javascript", + json: "application/json", + c: "text/x-csrc", + "c++": "text/x-c++src", + java: "text/x-java", + csharp: "text/x-csharp", + "c#": "text/x-csharp", + scala: "text/x-scala" + }; + + var getMode = (function () { + var i, modes = {}, mimes = {}, mime; + + var list = []; + for (var m in CodeMirror.modes) + if (CodeMirror.modes.propertyIsEnumerable(m)) list.push(m); + for (i = 0; i < list.length; i++) { + modes[list[i]] = list[i]; + } + var mimesList = []; + for (var m in CodeMirror.mimeModes) + if (CodeMirror.mimeModes.propertyIsEnumerable(m)) + mimesList.push({mime: m, mode: CodeMirror.mimeModes[m]}); + for (i = 0; i < mimesList.length; i++) { + mime = mimesList[i].mime; + mimes[mime] = mimesList[i].mime; + } + + for (var a in aliases) { + if (aliases[a] in modes || aliases[a] in mimes) + modes[a] = aliases[a]; + } + + return function (lang) { + return modes[lang] ? CodeMirror.getMode(cmCfg, modes[lang]) : null; + }; + }()); + + // Should underscores in words open/close em/strong? + if (modeCfg.underscoresBreakWords === undefined) + modeCfg.underscoresBreakWords = true; + + // Turn on fenced code blocks? ("```" to start/end) + if (modeCfg.fencedCodeBlocks === undefined) modeCfg.fencedCodeBlocks = false; + + // Turn on task lists? ("- [ ] " and "- [x] ") + if (modeCfg.taskLists === undefined) modeCfg.taskLists = false; + + var codeDepth = 0; + + var header = 'header' + , code = 'comment' + , quote1 = 'atom' + , quote2 = 'number' + , list1 = 'variable-2' + , list2 = 'variable-3' + , list3 = 'keyword' + , hr = 'hr' + , image = 'tag' + , linkinline = 'link' + , linkemail = 'link' + , linktext = 'link' + , linkhref = 'string' + , em = 'em' + , strong = 'strong'; + + var hrRE = /^([*\-=_])(?:\s*\1){2,}\s*$/ + , ulRE = /^[*\-+]\s+/ + , olRE = /^[0-9]+\.\s+/ + , taskListRE = /^\[(x| )\](?=\s)/ // Must follow ulRE or olRE + , headerRE = /^(?:\={1,}|-{1,})$/ + , textRE = /^[^!\[\]*_\\<>` "'(]+/; + + function switchInline(stream, state, f) { + state.f = state.inline = f; + return f(stream, state); + } + + function switchBlock(stream, state, f) { + state.f = state.block = f; + return f(stream, state); + } + + + // Blocks + + function blankLine(state) { + // Reset linkTitle state + state.linkTitle = false; + // Reset EM state + state.em = false; + // Reset STRONG state + state.strong = false; + // Reset state.quote + state.quote = 0; + if (!htmlFound && state.f == htmlBlock) { + state.f = inlineNormal; + state.block = blockNormal; + } + // Mark this line as blank + state.thisLineHasContent = false; + return null; + } + + function blockNormal(stream, state) { + + var prevLineIsList = (state.list !== false); + if (state.list !== false && state.indentationDiff >= 0) { // Continued list + if (state.indentationDiff < 4) { // Only adjust indentation if *not* a code block + state.indentation -= state.indentationDiff; + } + state.list = null; + } else if (state.list !== false && state.indentation > 0) { + state.list = null; + state.listDepth = Math.floor(state.indentation / 4); + } else if (state.list !== false) { // No longer a list + state.list = false; + state.listDepth = 0; + } + + if (state.indentationDiff >= 4) { + state.indentation -= 4; + stream.skipToEnd(); + return code; + } else if (stream.eatSpace()) { + return null; + } else if (stream.peek() === '#' || (state.prevLineHasContent && stream.match(headerRE)) ) { + state.header = true; + } else if (stream.eat('>')) { + state.indentation++; + state.quote = 1; + stream.eatSpace(); + while (stream.eat('>')) { + stream.eatSpace(); + state.quote++; + } + } else if (stream.peek() === '[') { + return switchInline(stream, state, footnoteLink); + } else if (stream.match(hrRE, true)) { + return hr; + } else if ((!state.prevLineHasContent || prevLineIsList) && (stream.match(ulRE, true) || stream.match(olRE, true))) { + state.indentation += 4; + state.list = true; + state.listDepth++; + if (modeCfg.taskLists && stream.match(taskListRE, false)) { + state.taskList = true; + } + } else if (modeCfg.fencedCodeBlocks && stream.match(/^```([\w+#]*)/, true)) { + // try switching mode + state.localMode = getMode(RegExp.$1); + if (state.localMode) state.localState = state.localMode.startState(); + switchBlock(stream, state, local); + return code; + } + + return switchInline(stream, state, state.inline); + } + + function htmlBlock(stream, state) { + var style = htmlMode.token(stream, state.htmlState); + if (htmlFound && style === 'tag' && state.htmlState.type !== 'openTag' && !state.htmlState.context) { + state.f = inlineNormal; + state.block = blockNormal; + } + if (state.md_inside && stream.current().indexOf(">")!=-1) { + state.f = inlineNormal; + state.block = blockNormal; + state.htmlState.context = undefined; + } + return style; + } + + function local(stream, state) { + if (stream.sol() && stream.match(/^```/, true)) { + state.localMode = state.localState = null; + state.f = inlineNormal; + state.block = blockNormal; + return code; + } else if (state.localMode) { + return state.localMode.token(stream, state.localState); + } else { + stream.skipToEnd(); + return code; + } + } + + // Inline + function getType(state) { + var styles = []; + + if (state.taskOpen) { return "meta"; } + if (state.taskClosed) { return "property"; } + + if (state.strong) { styles.push(strong); } + if (state.em) { styles.push(em); } + + if (state.linkText) { styles.push(linktext); } + + if (state.code) { styles.push(code); } + + if (state.header) { styles.push(header); } + if (state.quote) { styles.push(state.quote % 2 ? quote1 : quote2); } + if (state.list !== false) { + var listMod = (state.listDepth - 1) % 3; + if (!listMod) { + styles.push(list1); + } else if (listMod === 1) { + styles.push(list2); + } else { + styles.push(list3); + } + } + + return styles.length ? styles.join(' ') : null; + } + + function handleText(stream, state) { + if (stream.match(textRE, true)) { + return getType(state); + } + return undefined; + } + + function inlineNormal(stream, state) { + var style = state.text(stream, state); + if (typeof style !== 'undefined') + return style; + + if (state.list) { // List marker (*, +, -, 1., etc) + state.list = null; + return getType(state); + } + + if (state.taskList) { + var taskOpen = stream.match(taskListRE, true)[1] !== "x"; + if (taskOpen) state.taskOpen = true; + else state.taskClosed = true; + state.taskList = false; + return getType(state); + } + + state.taskOpen = false; + state.taskClosed = false; + + var ch = stream.next(); + + if (ch === '\\') { + stream.next(); + return getType(state); + } + + // Matches link titles present on next line + if (state.linkTitle) { + state.linkTitle = false; + var matchCh = ch; + if (ch === '(') { + matchCh = ')'; + } + matchCh = (matchCh+'').replace(/([.?*+^$[\]\\(){}|-])/g, "\\$1"); + var regex = '^\\s*(?:[^' + matchCh + '\\\\]+|\\\\\\\\|\\\\.)' + matchCh; + if (stream.match(new RegExp(regex), true)) { + return linkhref; + } + } + + // If this block is changed, it may need to be updated in GFM mode + if (ch === '`') { + var t = getType(state); + var before = stream.pos; + stream.eatWhile('`'); + var difference = 1 + stream.pos - before; + if (!state.code) { + codeDepth = difference; + state.code = true; + return getType(state); + } else { + if (difference === codeDepth) { // Must be exact + state.code = false; + return t; + } + return getType(state); + } + } else if (state.code) { + return getType(state); + } + + if (ch === '!' && stream.match(/\[[^\]]*\] ?(?:\(|\[)/, false)) { + stream.match(/\[[^\]]*\]/); + state.inline = state.f = linkHref; + return image; + } + + if (ch === '[' && stream.match(/.*\](\(| ?\[)/, false)) { + state.linkText = true; + return getType(state); + } + + if (ch === ']' && state.linkText) { + var type = getType(state); + state.linkText = false; + state.inline = state.f = linkHref; + return type; + } + + if (ch === '<' && stream.match(/^(https?|ftps?):\/\/(?:[^\\>]|\\.)+>/, false)) { + return switchInline(stream, state, inlineElement(linkinline, '>')); + } + + if (ch === '<' && stream.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/, false)) { + return switchInline(stream, state, inlineElement(linkemail, '>')); + } + + if (ch === '<' && stream.match(/^\w/, false)) { + if (stream.string.indexOf(">")!=-1) { + var atts = stream.string.substring(1,stream.string.indexOf(">")); + if (/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(atts)) { + state.md_inside = true; + } + } + stream.backUp(1); + return switchBlock(stream, state, htmlBlock); + } + + if (ch === '<' && stream.match(/^\/\w*?>/)) { + state.md_inside = false; + return "tag"; + } + + var ignoreUnderscore = false; + if (!modeCfg.underscoresBreakWords) { + if (ch === '_' && stream.peek() !== '_' && stream.match(/(\w)/, false)) { + var prevPos = stream.pos - 2; + if (prevPos >= 0) { + var prevCh = stream.string.charAt(prevPos); + if (prevCh !== '_' && prevCh.match(/(\w)/, false)) { + ignoreUnderscore = true; + } + } + } + } + var t = getType(state); + if (ch === '*' || (ch === '_' && !ignoreUnderscore)) { + if (state.strong === ch && stream.eat(ch)) { // Remove STRONG + state.strong = false; + return t; + } else if (!state.strong && stream.eat(ch)) { // Add STRONG + state.strong = ch; + return getType(state); + } else if (state.em === ch) { // Remove EM + state.em = false; + return t; + } else if (!state.em) { // Add EM + state.em = ch; + return getType(state); + } + } else if (ch === ' ') { + if (stream.eat('*') || stream.eat('_')) { // Probably surrounded by spaces + if (stream.peek() === ' ') { // Surrounded by spaces, ignore + return getType(state); + } else { // Not surrounded by spaces, back up pointer + stream.backUp(1); + } + } + } + + return getType(state); + } + + function linkHref(stream, state) { + // Check if space, and return NULL if so (to avoid marking the space) + if(stream.eatSpace()){ + return null; + } + var ch = stream.next(); + if (ch === '(' || ch === '[') { + return switchInline(stream, state, inlineElement(linkhref, ch === '(' ? ')' : ']')); + } + return 'error'; + } + + function footnoteLink(stream, state) { + if (stream.match(/^[^\]]*\]:/, true)) { + state.f = footnoteUrl; + return linktext; + } + return switchInline(stream, state, inlineNormal); + } + + function footnoteUrl(stream, state) { + // Check if space, and return NULL if so (to avoid marking the space) + if(stream.eatSpace()){ + return null; + } + // Match URL + stream.match(/^[^\s]+/, true); + // Check for link title + if (stream.peek() === undefined) { // End of line, set flag to check next line + state.linkTitle = true; + } else { // More content on line, check if link title + stream.match(/^(?:\s+(?:"(?:[^"\\]|\\\\|\\.)+"|'(?:[^'\\]|\\\\|\\.)+'|\((?:[^)\\]|\\\\|\\.)+\)))?/, true); + } + state.f = state.inline = inlineNormal; + return linkhref; + } + + var savedInlineRE = []; + function inlineRE(endChar) { + if (!savedInlineRE[endChar]) { + // Escape endChar for RegExp (taken from http://stackoverflow.com/a/494122/526741) + endChar = (endChar+'').replace(/([.?*+^$[\]\\(){}|-])/g, "\\$1"); + // Match any non-endChar, escaped character, as well as the closing + // endChar. + savedInlineRE[endChar] = new RegExp('^(?:[^\\\\]|\\\\.)*?(' + endChar + ')'); + } + return savedInlineRE[endChar]; + } + + function inlineElement(type, endChar, next) { + next = next || inlineNormal; + return function(stream, state) { + stream.match(inlineRE(endChar)); + state.inline = state.f = next; + return type; + }; + } + + return { + startState: function() { + return { + f: blockNormal, + + prevLineHasContent: false, + thisLineHasContent: false, + + block: blockNormal, + htmlState: CodeMirror.startState(htmlMode), + indentation: 0, + + inline: inlineNormal, + text: handleText, + + linkText: false, + linkTitle: false, + em: false, + strong: false, + header: false, + taskList: false, + list: false, + listDepth: 0, + quote: 0 + }; + }, + + copyState: function(s) { + return { + f: s.f, + + prevLineHasContent: s.prevLineHasContent, + thisLineHasContent: s.thisLineHasContent, + + block: s.block, + htmlState: CodeMirror.copyState(htmlMode, s.htmlState), + indentation: s.indentation, + + localMode: s.localMode, + localState: s.localMode ? CodeMirror.copyState(s.localMode, s.localState) : null, + + inline: s.inline, + text: s.text, + linkTitle: s.linkTitle, + em: s.em, + strong: s.strong, + header: s.header, + taskList: s.taskList, + list: s.list, + listDepth: s.listDepth, + quote: s.quote, + md_inside: s.md_inside + }; + }, + + token: function(stream, state) { + if (stream.sol()) { + if (stream.match(/^\s*$/, true)) { + state.prevLineHasContent = false; + return blankLine(state); + } else { + state.prevLineHasContent = state.thisLineHasContent; + state.thisLineHasContent = true; + } + + // Reset state.header + state.header = false; + + // Reset state.taskList + state.taskList = false; + + // Reset state.code + state.code = false; + + state.f = state.block; + var indentation = stream.match(/^\s*/, true)[0].replace(/\t/g, ' ').length; + var difference = Math.floor((indentation - state.indentation) / 4) * 4; + if (difference > 4) difference = 4; + var adjustedIndentation = state.indentation + difference; + state.indentationDiff = adjustedIndentation - state.indentation; + state.indentation = adjustedIndentation; + if (indentation > 0) return null; + } + return state.f(stream, state); + }, + + blankLine: blankLine, + + getType: getType + }; + +}, "xml"); + +CodeMirror.defineMIME("text/x-markdown", "markdown"); diff --git a/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/markdown/test.js b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/markdown/test.js new file mode 100644 index 000000000..99ae05613 --- /dev/null +++ b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/markdown/test.js @@ -0,0 +1,642 @@ +(function() { + var mode = CodeMirror.getMode({tabSize: 4}, "markdown"); + function MT(name) { test.mode(name, mode, Array.prototype.slice.call(arguments, 1)); } + + MT("plainText", + "foo"); + + // Code blocks using 4 spaces (regardless of CodeMirror.tabSize value) + MT("codeBlocksUsing4Spaces", + " [comment foo]"); + + // Code blocks using 4 spaces with internal indentation + MT("codeBlocksUsing4SpacesIndentation", + " [comment bar]", + " [comment hello]", + " [comment world]", + " [comment foo]", + "bar"); + + // Code blocks using 4 spaces with internal indentation + MT("codeBlocksUsing4SpacesIndentation", + " foo", + " [comment bar]", + " [comment hello]", + " [comment world]"); + + // Code blocks using 1 tab (regardless of CodeMirror.indentWithTabs value) + MT("codeBlocksUsing1Tab", + "\t[comment foo]"); + + // Inline code using backticks + MT("inlineCodeUsingBackticks", + "foo [comment `bar`]"); + + // Block code using single backtick (shouldn't work) + MT("blockCodeSingleBacktick", + "[comment `]", + "foo", + "[comment `]"); + + // Unclosed backticks + // Instead of simply marking as CODE, it would be nice to have an + // incomplete flag for CODE, that is styled slightly different. + MT("unclosedBackticks", + "foo [comment `bar]"); + + // Per documentation: "To include a literal backtick character within a + // code span, you can use multiple backticks as the opening and closing + // delimiters" + MT("doubleBackticks", + "[comment ``foo ` bar``]"); + + // Tests based on Dingus + // http://daringfireball.net/projects/markdown/dingus + // + // Multiple backticks within an inline code block + MT("consecutiveBackticks", + "[comment `foo```bar`]"); + + // Multiple backticks within an inline code block with a second code block + MT("consecutiveBackticks", + "[comment `foo```bar`] hello [comment `world`]"); + + // Unclosed with several different groups of backticks + MT("unclosedBackticks", + "[comment ``foo ``` bar` hello]"); + + // Closed with several different groups of backticks + MT("closedBackticks", + "[comment ``foo ``` bar` hello``] world"); + + // atx headers + // http://daringfireball.net/projects/markdown/syntax#header + + MT("atxH1", + "[header # foo]"); + + MT("atxH2", + "[header ## foo]"); + + MT("atxH3", + "[header ### foo]"); + + MT("atxH4", + "[header #### foo]"); + + MT("atxH5", + "[header ##### foo]"); + + MT("atxH6", + "[header ###### foo]"); + + // H6 - 7x '#' should still be H6, per Dingus + // http://daringfireball.net/projects/markdown/dingus + MT("atxH6NotH7", + "[header ####### foo]"); + + // Setext headers - H1, H2 + // Per documentation, "Any number of underlining =’s or -’s will work." + // http://daringfireball.net/projects/markdown/syntax#header + // Ideally, the text would be marked as `header` as well, but this is + // not really feasible at the moment. So, instead, we're testing against + // what works today, to avoid any regressions. + // + // Check if single underlining = works + MT("setextH1", + "foo", + "[header =]"); + + // Check if 3+ ='s work + MT("setextH1", + "foo", + "[header ===]"); + + // Check if single underlining - works + MT("setextH2", + "foo", + "[header -]"); + + // Check if 3+ -'s work + MT("setextH2", + "foo", + "[header ---]"); + + // Single-line blockquote with trailing space + MT("blockquoteSpace", + "[atom > foo]"); + + // Single-line blockquote + MT("blockquoteNoSpace", + "[atom >foo]"); + + // No blank line before blockquote + MT("blockquoteNoBlankLine", + "foo", + "[atom > bar]"); + + // Nested blockquote + MT("blockquoteSpace", + "[atom > foo]", + "[number > > foo]", + "[atom > > > foo]"); + + // Single-line blockquote followed by normal paragraph + MT("blockquoteThenParagraph", + "[atom >foo]", + "", + "bar"); + + // Multi-line blockquote (lazy mode) + MT("multiBlockquoteLazy", + "[atom >foo]", + "[atom bar]"); + + // Multi-line blockquote followed by normal paragraph (lazy mode) + MT("multiBlockquoteLazyThenParagraph", + "[atom >foo]", + "[atom bar]", + "", + "hello"); + + // Multi-line blockquote (non-lazy mode) + MT("multiBlockquote", + "[atom >foo]", + "[atom >bar]"); + + // Multi-line blockquote followed by normal paragraph (non-lazy mode) + MT("multiBlockquoteThenParagraph", + "[atom >foo]", + "[atom >bar]", + "", + "hello"); + + // Check list types + + MT("listAsterisk", + "foo", + "bar", + "", + "[variable-2 * foo]", + "[variable-2 * bar]"); + + MT("listPlus", + "foo", + "bar", + "", + "[variable-2 + foo]", + "[variable-2 + bar]"); + + MT("listDash", + "foo", + "bar", + "", + "[variable-2 - foo]", + "[variable-2 - bar]"); + + MT("listNumber", + "foo", + "bar", + "", + "[variable-2 1. foo]", + "[variable-2 2. bar]"); + + // Lists require a preceding blank line (per Dingus) + MT("listBogus", + "foo", + "1. bar", + "2. hello"); + + // Formatting in lists (*) + MT("listAsteriskFormatting", + "[variable-2 * ][variable-2&em *foo*][variable-2 bar]", + "[variable-2 * ][variable-2&strong **foo**][variable-2 bar]", + "[variable-2 * ][variable-2&strong **][variable-2&em&strong *foo**][variable-2&em *][variable-2 bar]", + "[variable-2 * ][variable-2&comment `foo`][variable-2 bar]"); + + // Formatting in lists (+) + MT("listPlusFormatting", + "[variable-2 + ][variable-2&em *foo*][variable-2 bar]", + "[variable-2 + ][variable-2&strong **foo**][variable-2 bar]", + "[variable-2 + ][variable-2&strong **][variable-2&em&strong *foo**][variable-2&em *][variable-2 bar]", + "[variable-2 + ][variable-2&comment `foo`][variable-2 bar]"); + + // Formatting in lists (-) + MT("listDashFormatting", + "[variable-2 - ][variable-2&em *foo*][variable-2 bar]", + "[variable-2 - ][variable-2&strong **foo**][variable-2 bar]", + "[variable-2 - ][variable-2&strong **][variable-2&em&strong *foo**][variable-2&em *][variable-2 bar]", + "[variable-2 - ][variable-2&comment `foo`][variable-2 bar]"); + + // Formatting in lists (1.) + MT("listNumberFormatting", + "[variable-2 1. ][variable-2&em *foo*][variable-2 bar]", + "[variable-2 2. ][variable-2&strong **foo**][variable-2 bar]", + "[variable-2 3. ][variable-2&strong **][variable-2&em&strong *foo**][variable-2&em *][variable-2 bar]", + "[variable-2 4. ][variable-2&comment `foo`][variable-2 bar]"); + + // Paragraph lists + MT("listParagraph", + "[variable-2 * foo]", + "", + "[variable-2 * bar]"); + + // Multi-paragraph lists + // + // 4 spaces + MT("listMultiParagraph", + "[variable-2 * foo]", + "", + "[variable-2 * bar]", + "", + " [variable-2 hello]"); + + // 4 spaces, extra blank lines (should still be list, per Dingus) + MT("listMultiParagraphExtra", + "[variable-2 * foo]", + "", + "[variable-2 * bar]", + "", + "", + " [variable-2 hello]"); + + // 4 spaces, plus 1 space (should still be list, per Dingus) + MT("listMultiParagraphExtraSpace", + "[variable-2 * foo]", + "", + "[variable-2 * bar]", + "", + " [variable-2 hello]", + "", + " [variable-2 world]"); + + // 1 tab + MT("listTab", + "[variable-2 * foo]", + "", + "[variable-2 * bar]", + "", + "\t[variable-2 hello]"); + + // No indent + MT("listNoIndent", + "[variable-2 * foo]", + "", + "[variable-2 * bar]", + "", + "hello"); + + // Blockquote + MT("blockquote", + "[variable-2 * foo]", + "", + "[variable-2 * bar]", + "", + " [variable-2&atom > hello]"); + + // Code block + MT("blockquoteCode", + "[variable-2 * foo]", + "", + "[variable-2 * bar]", + "", + " [comment > hello]", + "", + " [variable-2 world]"); + + // Code block followed by text + MT("blockquoteCodeText", + "[variable-2 * foo]", + "", + " [variable-2 bar]", + "", + " [comment hello]", + "", + " [variable-2 world]"); + + // Nested list + + MT("listAsteriskNested", + "[variable-2 * foo]", + "", + " [variable-3 * bar]"); + + MT("listPlusNested", + "[variable-2 + foo]", + "", + " [variable-3 + bar]"); + + MT("listDashNested", + "[variable-2 - foo]", + "", + " [variable-3 - bar]"); + + MT("listNumberNested", + "[variable-2 1. foo]", + "", + " [variable-3 2. bar]"); + + MT("listMixed", + "[variable-2 * foo]", + "", + " [variable-3 + bar]", + "", + " [keyword - hello]", + "", + " [variable-2 1. world]"); + + MT("listBlockquote", + "[variable-2 * foo]", + "", + " [variable-3 + bar]", + "", + " [atom&variable-3 > hello]"); + + MT("listCode", + "[variable-2 * foo]", + "", + " [variable-3 + bar]", + "", + " [comment hello]"); + + // Code with internal indentation + MT("listCodeIndentation", + "[variable-2 * foo]", + "", + " [comment bar]", + " [comment hello]", + " [comment world]", + " [comment foo]", + " [variable-2 bar]"); + + // List nesting edge cases + MT("listNested", + "[variable-2 * foo]", + "", + " [variable-3 * bar]", + "", + " [variable-2 hello]" + ); + MT("listNested", + "[variable-2 * foo]", + "", + " [variable-3 * bar]", + "", + " [variable-3 * foo]" + ); + + // Code followed by text + MT("listCodeText", + "[variable-2 * foo]", + "", + " [comment bar]", + "", + "hello"); + + // Following tests directly from official Markdown documentation + // http://daringfireball.net/projects/markdown/syntax#hr + + MT("hrSpace", + "[hr * * *]"); + + MT("hr", + "[hr ***]"); + + MT("hrLong", + "[hr *****]"); + + MT("hrSpaceDash", + "[hr - - -]"); + + MT("hrDashLong", + "[hr ---------------------------------------]"); + + // Inline link with title + MT("linkTitle", + "[link [[foo]]][string (http://example.com/ \"bar\")] hello"); + + // Inline link without title + MT("linkNoTitle", + "[link [[foo]]][string (http://example.com/)] bar"); + + // Inline link with image + MT("linkImage", + "[link [[][tag ![[foo]]][string (http://example.com/)][link ]]][string (http://example.com/)] bar"); + + // Inline link with Em + MT("linkEm", + "[link [[][link&em *foo*][link ]]][string (http://example.com/)] bar"); + + // Inline link with Strong + MT("linkStrong", + "[link [[][link&strong **foo**][link ]]][string (http://example.com/)] bar"); + + // Inline link with EmStrong + MT("linkEmStrong", + "[link [[][link&strong **][link&em&strong *foo**][link&em *][link ]]][string (http://example.com/)] bar"); + + // Image with title + MT("imageTitle", + "[tag ![[foo]]][string (http://example.com/ \"bar\")] hello"); + + // Image without title + MT("imageNoTitle", + "[tag ![[foo]]][string (http://example.com/)] bar"); + + // Image with asterisks + MT("imageAsterisks", + "[tag ![[*foo*]]][string (http://example.com/)] bar"); + + // Not a link. Should be normal text due to square brackets being used + // regularly in text, especially in quoted material, and no space is allowed + // between square brackets and parentheses (per Dingus). + MT("notALink", + "[[foo]] (bar)"); + + // Reference-style links + MT("linkReference", + "[link [[foo]]][string [[bar]]] hello"); + + // Reference-style links with Em + MT("linkReferenceEm", + "[link [[][link&em *foo*][link ]]][string [[bar]]] hello"); + + // Reference-style links with Strong + MT("linkReferenceStrong", + "[link [[][link&strong **foo**][link ]]][string [[bar]]] hello"); + + // Reference-style links with EmStrong + MT("linkReferenceEmStrong", + "[link [[][link&strong **][link&em&strong *foo**][link&em *][link ]]][string [[bar]]] hello"); + + // Reference-style links with optional space separator (per docuentation) + // "You can optionally use a space to separate the sets of brackets" + MT("linkReferenceSpace", + "[link [[foo]]] [string [[bar]]] hello"); + + // Should only allow a single space ("...use *a* space...") + MT("linkReferenceDoubleSpace", + "[[foo]] [[bar]] hello"); + + // Reference-style links with implicit link name + MT("linkImplicit", + "[link [[foo]]][string [[]]] hello"); + + // @todo It would be nice if, at some point, the document was actually + // checked to see if the referenced link exists + + // Link label, for reference-style links (taken from documentation) + + MT("labelNoTitle", + "[link [[foo]]:] [string http://example.com/]"); + + MT("labelIndented", + " [link [[foo]]:] [string http://example.com/]"); + + MT("labelSpaceTitle", + "[link [[foo bar]]:] [string http://example.com/ \"hello\"]"); + + MT("labelDoubleTitle", + "[link [[foo bar]]:] [string http://example.com/ \"hello\"] \"world\""); + + MT("labelTitleDoubleQuotes", + "[link [[foo]]:] [string http://example.com/ \"bar\"]"); + + MT("labelTitleSingleQuotes", + "[link [[foo]]:] [string http://example.com/ 'bar']"); + + MT("labelTitleParenthese", + "[link [[foo]]:] [string http://example.com/ (bar)]"); + + MT("labelTitleInvalid", + "[link [[foo]]:] [string http://example.com/] bar"); + + MT("labelLinkAngleBrackets", + "[link [[foo]]:] [string \"bar\"]"); + + MT("labelTitleNextDoubleQuotes", + "[link [[foo]]:] [string http://example.com/]", + "[string \"bar\"] hello"); + + MT("labelTitleNextSingleQuotes", + "[link [[foo]]:] [string http://example.com/]", + "[string 'bar'] hello"); + + MT("labelTitleNextParenthese", + "[link [[foo]]:] [string http://example.com/]", + "[string (bar)] hello"); + + MT("labelTitleNextMixed", + "[link [[foo]]:] [string http://example.com/]", + "(bar\" hello"); + + MT("linkWeb", + "[link ] foo"); + + MT("linkWebDouble", + "[link ] foo [link ]"); + + MT("linkEmail", + "[link ] foo"); + + MT("linkEmailDouble", + "[link ] foo [link ]"); + + MT("emAsterisk", + "[em *foo*] bar"); + + MT("emUnderscore", + "[em _foo_] bar"); + + MT("emInWordAsterisk", + "foo[em *bar*]hello"); + + MT("emInWordUnderscore", + "foo[em _bar_]hello"); + + // Per documentation: "...surround an * or _ with spaces, it’ll be + // treated as a literal asterisk or underscore." + + MT("emEscapedBySpaceIn", + "foo [em _bar _ hello_] world"); + + MT("emEscapedBySpaceOut", + "foo _ bar[em _hello_]world"); + + // Unclosed emphasis characters + // Instead of simply marking as EM / STRONG, it would be nice to have an + // incomplete flag for EM and STRONG, that is styled slightly different. + MT("emIncompleteAsterisk", + "foo [em *bar]"); + + MT("emIncompleteUnderscore", + "foo [em _bar]"); + + MT("strongAsterisk", + "[strong **foo**] bar"); + + MT("strongUnderscore", + "[strong __foo__] bar"); + + MT("emStrongAsterisk", + "[em *foo][em&strong **bar*][strong hello**] world"); + + MT("emStrongUnderscore", + "[em _foo][em&strong __bar_][strong hello__] world"); + + // "...same character must be used to open and close an emphasis span."" + MT("emStrongMixed", + "[em _foo][em&strong **bar*hello__ world]"); + + MT("emStrongMixed", + "[em *foo][em&strong __bar_hello** world]"); + + // These characters should be escaped: + // \ backslash + // ` backtick + // * asterisk + // _ underscore + // {} curly braces + // [] square brackets + // () parentheses + // # hash mark + // + plus sign + // - minus sign (hyphen) + // . dot + // ! exclamation mark + + MT("escapeBacktick", + "foo \\`bar\\`"); + + MT("doubleEscapeBacktick", + "foo \\\\[comment `bar\\\\`]"); + + MT("escapeAsterisk", + "foo \\*bar\\*"); + + MT("doubleEscapeAsterisk", + "foo \\\\[em *bar\\\\*]"); + + MT("escapeUnderscore", + "foo \\_bar\\_"); + + MT("doubleEscapeUnderscore", + "foo \\\\[em _bar\\\\_]"); + + MT("escapeHash", + "\\# foo"); + + MT("doubleEscapeHash", + "\\\\# foo"); + + + // Tests to make sure GFM-specific things aren't getting through + + MT("taskList", + "[variable-2 * [ ]] bar]"); + + MT("fencedCodeBlocks", + "[comment ```]", + "foo", + "[comment ```]"); +})(); diff --git a/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/meta.js b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/meta.js new file mode 100644 index 000000000..e8cfc8fb6 --- /dev/null +++ b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/meta.js @@ -0,0 +1,77 @@ +CodeMirror.modeInfo = [ + {name: 'APL', mime: 'text/apl', mode: 'apl'}, + {name: 'Asterisk', mime: 'text/x-asterisk', mode: 'asterisk'}, + {name: 'C', mime: 'text/x-csrc', mode: 'clike'}, + {name: 'C++', mime: 'text/x-c++src', mode: 'clike'}, + {name: 'Cobol', mime: 'text/x-cobol', mode: 'cobol'}, + {name: 'Java', mime: 'text/x-java', mode: 'clike'}, + {name: 'C#', mime: 'text/x-csharp', mode: 'clike'}, + {name: 'Scala', mime: 'text/x-scala', mode: 'clike'}, + {name: 'Clojure', mime: 'text/x-clojure', mode: 'clojure'}, + {name: 'CoffeeScript', mime: 'text/x-coffeescript', mode: 'coffeescript'}, + {name: 'Common Lisp', mime: 'text/x-common-lisp', mode: 'commonlisp'}, + {name: 'CSS', mime: 'text/css', mode: 'css'}, + {name: 'D', mime: 'text/x-d', mode: 'd'}, + {name: 'diff', mime: 'text/x-diff', mode: 'diff'}, + {name: 'ECL', mime: 'text/x-ecl', mode: 'ecl'}, + {name: 'Erlang', mime: 'text/x-erlang', mode: 'erlang'}, + {name: 'Gas', mime: 'text/x-gas', mode: 'gas'}, + {name: 'GitHub Flavored Markdown', mode: 'gfm'}, + {name: 'GO', mime: 'text/x-go', mode: 'go'}, + {name: 'Groovy', mime: 'text/x-groovy', mode: 'groovy'}, + {name: 'Haskell', mime: 'text/x-haskell', mode: 'haskell'}, + {name: 'Haxe', mime: 'text/x-haxe', mode: 'haxe'}, + {name: 'ASP.NET', mime: 'application/x-aspx', mode: 'htmlembedded'}, + {name: 'Embedded Javascript', mime: 'application/x-ejs', mode: 'htmlembedded'}, + {name: 'JavaServer Pages', mime: 'application/x-jsp', mode: 'htmlembedded'}, + {name: 'HTML', mime: 'text/html', mode: 'htmlmixed'}, + {name: 'HTTP', mime: 'message/http', mode: 'http'}, + {name: 'JavaScript', mime: 'text/javascript', mode: 'javascript'}, + {name: 'JSON', mime: 'application/x-json', mode: 'javascript'}, + {name: 'JSON', mime: 'application/json', mode: 'javascript'}, + {name: 'TypeScript', mime: 'application/typescript', mode: 'javascript'}, + {name: 'Jinja2', mime: 'jinja2', mode: 'jinja2'}, + {name: 'LESS', mime: 'text/x-less', mode: 'less'}, + {name: 'LiveScript', mime: 'text/x-livescript', mode: 'livescript'}, + {name: 'Lua', mime: 'text/x-lua', mode: 'lua'}, + {name: 'Markdown (GitHub-flavour)', mime: 'text/x-markdown', mode: 'markdown'}, + {name: 'mIRC', mime: 'text/mirc', mode: 'mirc'}, + {name: 'NTriples', mime: 'text/n-triples', mode: 'ntriples'}, + {name: 'OCaml', mime: 'text/x-ocaml', mode: 'ocaml'}, + {name: 'Pascal', mime: 'text/x-pascal', mode: 'pascal'}, + {name: 'Perl', mime: 'text/x-perl', mode: 'perl'}, + {name: 'PHP', mime: 'text/x-php', mode: 'php'}, + {name: 'PHP(HTML)', mime: 'application/x-httpd-php', mode: 'php'}, + {name: 'Pig', mime: 'text/x-pig', mode: 'pig'}, + {name: 'Plain Text', mime: 'text/plain', mode: 'null'}, + {name: 'Properties files', mime: 'text/x-properties', mode: 'clike'}, + {name: 'Python', mime: 'text/x-python', mode: 'python'}, + {name: 'R', mime: 'text/x-rsrc', mode: 'r'}, + {name: 'reStructuredText', mime: 'text/x-rst', mode: 'rst'}, + {name: 'Ruby', mime: 'text/x-ruby', mode: 'ruby'}, + {name: 'Rust', mime: 'text/x-rustsrc', mode: 'rust'}, + {name: 'Sass', mime: 'text/x-sass', mode: 'sass'}, + {name: 'Scheme', mime: 'text/x-scheme', mode: 'scheme'}, + {name: 'SCSS', mime: 'text/x-scss', mode: 'css'}, + {name: 'Shell', mime: 'text/x-sh', mode: 'shell'}, + {name: 'Sieve', mime: 'application/sieve', mode: 'sieve'}, + {name: 'Smalltalk', mime: 'text/x-stsrc', mode: 'smalltalk'}, + {name: 'Smarty', mime: 'text/x-smarty', mode: 'smarty'}, + {name: 'SPARQL', mime: 'application/x-sparql-query', mode: 'sparql'}, + {name: 'SQL', mime: 'text/x-sql', mode: 'sql'}, + {name: 'MariaDB', mime: 'text/x-mariadb', mode: 'sql'}, + {name: 'sTeX', mime: 'text/x-stex', mode: 'stex'}, + {name: 'LaTeX', mime: 'text/x-latex', mode: 'stex'}, + {name: 'Tcl', mime: 'text/x-tcl', mode: 'tcl'}, + {name: 'TiddlyWiki ', mime: 'text/x-tiddlywiki', mode: 'tiddlywiki'}, + {name: 'Tiki wiki', mime: 'text/tiki', mode: 'tiki'}, + {name: 'VB.NET', mime: 'text/x-vb', mode: 'vb'}, + {name: 'VBScript', mime: 'text/vbscript', mode: 'vbscript'}, + {name: 'Velocity', mime: 'text/velocity', mode: 'velocity'}, + {name: 'Verilog', mime: 'text/x-verilog', mode: 'verilog'}, + {name: 'XML', mime: 'application/xml', mode: 'xml'}, + {name: 'HTML', mime: 'text/html', mode: 'xml'}, + {name: 'XQuery', mime: 'application/xquery', mode: 'xquery'}, + {name: 'YAML', mime: 'text/x-yaml', mode: 'yaml'}, + {name: 'Z80', mime: 'text/x-z80', mode: 'z80'} +]; diff --git a/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/mirc/index.html b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/mirc/index.html new file mode 100644 index 000000000..0ff5ec9a2 --- /dev/null +++ b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/mirc/index.html @@ -0,0 +1,149 @@ + + + + + CodeMirror: mIRC mode + + + + + + + + +

CodeMirror: mIRC mode

+
+ + +

MIME types defined: text/mirc.

+ + + diff --git a/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/mirc/mirc.js b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/mirc/mirc.js new file mode 100644 index 000000000..fc88bc56f --- /dev/null +++ b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/mirc/mirc.js @@ -0,0 +1,177 @@ +//mIRC mode by Ford_Lawnmower :: Based on Velocity mode by Steve O'Hara +CodeMirror.defineMIME("text/mirc", "mirc"); +CodeMirror.defineMode("mirc", function() { + function parseWords(str) { + var obj = {}, words = str.split(" "); + for (var i = 0; i < words.length; ++i) obj[words[i]] = true; + return obj; + } + var specials = parseWords("$! $$ $& $? $+ $abook $abs $active $activecid " + + "$activewid $address $addtok $agent $agentname $agentstat $agentver " + + "$alias $and $anick $ansi2mirc $aop $appactive $appstate $asc $asctime " + + "$asin $atan $avoice $away $awaymsg $awaytime $banmask $base $bfind " + + "$binoff $biton $bnick $bvar $bytes $calc $cb $cd $ceil $chan $chanmodes " + + "$chantypes $chat $chr $cid $clevel $click $cmdbox $cmdline $cnick $color " + + "$com $comcall $comchan $comerr $compact $compress $comval $cos $count " + + "$cr $crc $creq $crlf $ctime $ctimer $ctrlenter $date $day $daylight " + + "$dbuh $dbuw $dccignore $dccport $dde $ddename $debug $decode $decompress " + + "$deltok $devent $dialog $did $didreg $didtok $didwm $disk $dlevel $dll " + + "$dllcall $dname $dns $duration $ebeeps $editbox $emailaddr $encode $error " + + "$eval $event $exist $feof $ferr $fgetc $file $filename $filtered $finddir " + + "$finddirn $findfile $findfilen $findtok $fline $floor $fopen $fread $fserve " + + "$fulladdress $fulldate $fullname $fullscreen $get $getdir $getdot $gettok $gmt " + + "$group $halted $hash $height $hfind $hget $highlight $hnick $hotline " + + "$hotlinepos $ial $ialchan $ibl $idle $iel $ifmatch $ignore $iif $iil " + + "$inelipse $ini $inmidi $inpaste $inpoly $input $inrect $inroundrect " + + "$insong $instok $int $inwave $ip $isalias $isbit $isdde $isdir $isfile " + + "$isid $islower $istok $isupper $keychar $keyrpt $keyval $knick $lactive " + + "$lactivecid $lactivewid $left $len $level $lf $line $lines $link $lock " + + "$lock $locked $log $logstamp $logstampfmt $longfn $longip $lower $ltimer " + + "$maddress $mask $matchkey $matchtok $md5 $me $menu $menubar $menucontext " + + "$menutype $mid $middir $mircdir $mircexe $mircini $mklogfn $mnick $mode " + + "$modefirst $modelast $modespl $mouse $msfile $network $newnick $nick $nofile " + + "$nopath $noqt $not $notags $notify $null $numeric $numok $oline $onpoly " + + "$opnick $or $ord $os $passivedcc $pic $play $pnick $port $portable $portfree " + + "$pos $prefix $prop $protect $puttok $qt $query $rand $r $rawmsg $read $readomo " + + "$readn $regex $regml $regsub $regsubex $remove $remtok $replace $replacex " + + "$reptok $result $rgb $right $round $scid $scon $script $scriptdir $scriptline " + + "$sdir $send $server $serverip $sfile $sha1 $shortfn $show $signal $sin " + + "$site $sline $snick $snicks $snotify $sock $sockbr $sockerr $sockname " + + "$sorttok $sound $sqrt $ssl $sreq $sslready $status $strip $str $stripped " + + "$syle $submenu $switchbar $tan $target $ticks $time $timer $timestamp " + + "$timestampfmt $timezone $tip $titlebar $toolbar $treebar $trust $ulevel " + + "$ulist $upper $uptime $url $usermode $v1 $v2 $var $vcmd $vcmdstat $vcmdver " + + "$version $vnick $vol $wid $width $wildsite $wildtok $window $wrap $xor"); + var keywords = parseWords("abook ajinvite alias aline ame amsg anick aop auser autojoin avoice " + + "away background ban bcopy beep bread break breplace bset btrunc bunset bwrite " + + "channel clear clearall cline clipboard close cnick color comclose comopen " + + "comreg continue copy creq ctcpreply ctcps dcc dccserver dde ddeserver " + + "debug dec describe dialog did didtok disable disconnect dlevel dline dll " + + "dns dqwindow drawcopy drawdot drawfill drawline drawpic drawrect drawreplace " + + "drawrot drawsave drawscroll drawtext ebeeps echo editbox emailaddr enable " + + "events exit fclose filter findtext finger firewall flash flist flood flush " + + "flushini font fopen fseek fsend fserve fullname fwrite ghide gload gmove " + + "gopts goto gplay gpoint gqreq groups gshow gsize gstop gtalk gunload hadd " + + "halt haltdef hdec hdel help hfree hinc hload hmake hop hsave ial ialclear " + + "ialmark identd if ignore iline inc invite iuser join kick linesep links list " + + "load loadbuf localinfo log mdi me menubar mkdir mnick mode msg nick noop notice " + + "notify omsg onotice part partall pdcc perform play playctrl pop protect pvoice " + + "qme qmsg query queryn quit raw reload remini remote remove rename renwin " + + "reseterror resetidle return rlevel rline rmdir run ruser save savebuf saveini " + + "say scid scon server set showmirc signam sline sockaccept sockclose socklist " + + "socklisten sockmark sockopen sockpause sockread sockrename sockudp sockwrite " + + "sound speak splay sreq strip switchbar timer timestamp titlebar tnick tokenize " + + "toolbar topic tray treebar ulist unload unset unsetall updatenl url uwho " + + "var vcadd vcmd vcrem vol while whois window winhelp write writeint if isalnum " + + "isalpha isaop isavoice isban ischan ishop isignore isin isincs isletter islower " + + "isnotify isnum ison isop isprotect isreg isupper isvoice iswm iswmcs " + + "elseif else goto menu nicklist status title icon size option text edit " + + "button check radio box scroll list combo link tab item"); + var functions = parseWords("if elseif else and not or eq ne in ni for foreach while switch"); + 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(); + if (/[\[\]{}\(\),\.]/.test(ch)) { + if (ch == "(" && beforeParams) state.inParams = true; + else if (ch == ")") state.inParams = false; + return null; + } + else if (/\d/.test(ch)) { + stream.eatWhile(/[\w\.]/); + return "number"; + } + else if (ch == "\\") { + stream.eat("\\"); + stream.eat(/./); + return "number"; + } + else if (ch == "/" && stream.eat("*")) { + return chain(stream, state, tokenComment); + } + else if (ch == ";" && stream.match(/ *\( *\(/)) { + return chain(stream, state, tokenUnparsed); + } + else if (ch == ";" && !state.inParams) { + stream.skipToEnd(); + return "comment"; + } + else if (ch == '"') { + stream.eat(/"/); + return "keyword"; + } + else if (ch == "$") { + stream.eatWhile(/[$_a-z0-9A-Z\.:]/); + if (specials && specials.propertyIsEnumerable(stream.current().toLowerCase())) { + return "keyword"; + } + else { + state.beforeParams = true; + return "builtin"; + } + } + else if (ch == "%") { + stream.eatWhile(/[^,^\s^\(^\)]/); + state.beforeParams = true; + return "string"; + } + else if (isOperatorChar.test(ch)) { + stream.eatWhile(isOperatorChar); + return "operator"; + } + else { + stream.eatWhile(/[\w\$_{}]/); + var word = stream.current().toLowerCase(); + if (keywords && keywords.propertyIsEnumerable(word)) + return "keyword"; + if (functions && functions.propertyIsEnumerable(word)) { + state.beforeParams = true; + return "keyword"; + } + return null; + } + } + 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"; + } + return { + startState: function() { + return { + tokenize: tokenBase, + beforeParams: false, + inParams: false + }; + }, + token: function(stream, state) { + if (stream.eatSpace()) return null; + return state.tokenize(stream, state); + } + }; +}); diff --git a/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/ntriples/index.html b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/ntriples/index.html new file mode 100644 index 000000000..052a53d86 --- /dev/null +++ b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/ntriples/index.html @@ -0,0 +1,33 @@ + + + + + CodeMirror: NTriples mode + + + + + + + +

CodeMirror: NTriples mode

+
+ +
+ + +

MIME types defined: text/n-triples.

+ + diff --git a/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/ntriples/ntriples.js b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/ntriples/ntriples.js new file mode 100644 index 000000000..ed0cee34b --- /dev/null +++ b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/ntriples/ntriples.js @@ -0,0 +1,170 @@ +/********************************************************** +* This script provides syntax highlighting support for +* the Ntriples format. +* Ntriples format specification: +* http://www.w3.org/TR/rdf-testcases/#ntriples +***********************************************************/ + +/* + The following expression defines the defined ASF grammar transitions. + + pre_subject -> + { + ( writing_subject_uri | writing_bnode_uri ) + -> pre_predicate + -> writing_predicate_uri + -> pre_object + -> writing_object_uri | writing_object_bnode | + ( + writing_object_literal + -> writing_literal_lang | writing_literal_type + ) + -> post_object + -> BEGIN + } otherwise { + -> ERROR + } +*/ +CodeMirror.defineMode("ntriples", function() { + + var Location = { + PRE_SUBJECT : 0, + WRITING_SUB_URI : 1, + WRITING_BNODE_URI : 2, + PRE_PRED : 3, + WRITING_PRED_URI : 4, + PRE_OBJ : 5, + WRITING_OBJ_URI : 6, + WRITING_OBJ_BNODE : 7, + WRITING_OBJ_LITERAL : 8, + WRITING_LIT_LANG : 9, + WRITING_LIT_TYPE : 10, + POST_OBJ : 11, + ERROR : 12 + }; + function transitState(currState, c) { + var currLocation = currState.location; + var ret; + + // Opening. + if (currLocation == Location.PRE_SUBJECT && c == '<') ret = Location.WRITING_SUB_URI; + else if(currLocation == Location.PRE_SUBJECT && c == '_') ret = Location.WRITING_BNODE_URI; + else if(currLocation == Location.PRE_PRED && c == '<') ret = Location.WRITING_PRED_URI; + else if(currLocation == Location.PRE_OBJ && c == '<') ret = Location.WRITING_OBJ_URI; + else if(currLocation == Location.PRE_OBJ && c == '_') ret = Location.WRITING_OBJ_BNODE; + else if(currLocation == Location.PRE_OBJ && c == '"') ret = Location.WRITING_OBJ_LITERAL; + + // Closing. + else if(currLocation == Location.WRITING_SUB_URI && c == '>') ret = Location.PRE_PRED; + else if(currLocation == Location.WRITING_BNODE_URI && c == ' ') ret = Location.PRE_PRED; + else if(currLocation == Location.WRITING_PRED_URI && c == '>') ret = Location.PRE_OBJ; + else if(currLocation == Location.WRITING_OBJ_URI && c == '>') ret = Location.POST_OBJ; + else if(currLocation == Location.WRITING_OBJ_BNODE && c == ' ') ret = Location.POST_OBJ; + else if(currLocation == Location.WRITING_OBJ_LITERAL && c == '"') ret = Location.POST_OBJ; + else if(currLocation == Location.WRITING_LIT_LANG && c == ' ') ret = Location.POST_OBJ; + else if(currLocation == Location.WRITING_LIT_TYPE && c == '>') ret = Location.POST_OBJ; + + // Closing typed and language literal. + else if(currLocation == Location.WRITING_OBJ_LITERAL && c == '@') ret = Location.WRITING_LIT_LANG; + else if(currLocation == Location.WRITING_OBJ_LITERAL && c == '^') ret = Location.WRITING_LIT_TYPE; + + // Spaces. + else if( c == ' ' && + ( + currLocation == Location.PRE_SUBJECT || + currLocation == Location.PRE_PRED || + currLocation == Location.PRE_OBJ || + currLocation == Location.POST_OBJ + ) + ) ret = currLocation; + + // Reset. + else if(currLocation == Location.POST_OBJ && c == '.') ret = Location.PRE_SUBJECT; + + // Error + else ret = Location.ERROR; + + currState.location=ret; + } + + return { + startState: function() { + return { + location : Location.PRE_SUBJECT, + uris : [], + anchors : [], + bnodes : [], + langs : [], + types : [] + }; + }, + token: function(stream, state) { + var ch = stream.next(); + if(ch == '<') { + transitState(state, ch); + var parsedURI = ''; + stream.eatWhile( function(c) { if( c != '#' && c != '>' ) { parsedURI += c; return true; } return false;} ); + state.uris.push(parsedURI); + if( stream.match('#', false) ) return 'variable'; + stream.next(); + transitState(state, '>'); + return 'variable'; + } + if(ch == '#') { + var parsedAnchor = ''; + stream.eatWhile(function(c) { if(c != '>' && c != ' ') { parsedAnchor+= c; return true; } return false;}); + state.anchors.push(parsedAnchor); + return 'variable-2'; + } + if(ch == '>') { + transitState(state, '>'); + return 'variable'; + } + if(ch == '_') { + transitState(state, ch); + var parsedBNode = ''; + stream.eatWhile(function(c) { if( c != ' ' ) { parsedBNode += c; return true; } return false;}); + state.bnodes.push(parsedBNode); + stream.next(); + transitState(state, ' '); + return 'builtin'; + } + if(ch == '"') { + transitState(state, ch); + stream.eatWhile( function(c) { return c != '"'; } ); + stream.next(); + if( stream.peek() != '@' && stream.peek() != '^' ) { + transitState(state, '"'); + } + return 'string'; + } + if( ch == '@' ) { + transitState(state, '@'); + var parsedLang = ''; + stream.eatWhile(function(c) { if( c != ' ' ) { parsedLang += c; return true; } return false;}); + state.langs.push(parsedLang); + stream.next(); + transitState(state, ' '); + return 'string-2'; + } + if( ch == '^' ) { + stream.next(); + transitState(state, '^'); + var parsedType = ''; + stream.eatWhile(function(c) { if( c != '>' ) { parsedType += c; return true; } return false;} ); + state.types.push(parsedType); + stream.next(); + transitState(state, '>'); + return 'variable'; + } + if( ch == ' ' ) { + transitState(state, ch); + } + if( ch == '.' ) { + transitState(state, ch); + } + } + }; +}); + +CodeMirror.defineMIME("text/n-triples", "ntriples"); diff --git a/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/ocaml/index.html b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/ocaml/index.html new file mode 100644 index 000000000..c10a84fad --- /dev/null +++ b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/ocaml/index.html @@ -0,0 +1,131 @@ + + +CodeMirror: OCaml mode + + + + + + + + + + +

CodeMirror: OCaml mode

+ + + + + +

MIME types defined: text/x-ocaml.

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.

+ +

MIME types defined: application/x-httpd-php (HTML with PHP code), text/x-php (plain, non-wrapped PHP code).

+ + diff --git a/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/php/php.js b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/php/php.js new file mode 100644 index 000000000..fa0db5b1f --- /dev/null +++ b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/php/php.js @@ -0,0 +1,132 @@ +(function() { + function keywords(str) { + var obj = {}, words = str.split(" "); + for (var i = 0; i < words.length; ++i) obj[words[i]] = true; + return obj; + } + function heredoc(delim) { + return function(stream, state) { + if (stream.match(delim)) state.tokenize = null; + else stream.skipToEnd(); + return "string"; + }; + } + var phpConfig = { + name: "clike", + keywords: keywords("abstract and array as break case catch class clone const continue declare default " + + "do else elseif enddeclare endfor endforeach endif endswitch endwhile extends final " + + "for foreach function global goto if implements interface instanceof namespace " + + "new or private protected public static switch throw trait try use var while xor " + + "die echo empty exit eval include include_once isset list require require_once return " + + "print unset __halt_compiler self static parent"), + blockKeywords: keywords("catch do else elseif for foreach if switch try while"), + atoms: keywords("true false null TRUE FALSE NULL __CLASS__ __DIR__ __FILE__ __LINE__ __METHOD__ __FUNCTION__ __NAMESPACE__"), + builtin: keywords("func_num_args func_get_arg func_get_args strlen strcmp strncmp strcasecmp strncasecmp each error_reporting define defined trigger_error user_error set_error_handler restore_error_handler get_declared_classes get_loaded_extensions extension_loaded get_extension_funcs debug_backtrace constant bin2hex sleep usleep time mktime gmmktime strftime gmstrftime strtotime date gmdate getdate localtime checkdate flush wordwrap htmlspecialchars htmlentities html_entity_decode md5 md5_file crc32 getimagesize image_type_to_mime_type phpinfo phpversion phpcredits strnatcmp strnatcasecmp substr_count strspn strcspn strtok strtoupper strtolower strpos strrpos strrev hebrev hebrevc nl2br basename dirname pathinfo stripslashes stripcslashes strstr stristr strrchr str_shuffle str_word_count strcoll substr substr_replace quotemeta ucfirst ucwords strtr addslashes addcslashes rtrim str_replace str_repeat count_chars chunk_split trim ltrim strip_tags similar_text explode implode setlocale localeconv parse_str str_pad chop strchr sprintf printf vprintf vsprintf sscanf fscanf parse_url urlencode urldecode rawurlencode rawurldecode readlink linkinfo link unlink exec system escapeshellcmd escapeshellarg passthru shell_exec proc_open proc_close rand srand getrandmax mt_rand mt_srand mt_getrandmax base64_decode base64_encode abs ceil floor round is_finite is_nan is_infinite bindec hexdec octdec decbin decoct dechex base_convert number_format fmod ip2long long2ip getenv putenv getopt microtime gettimeofday getrusage uniqid quoted_printable_decode set_time_limit get_cfg_var magic_quotes_runtime set_magic_quotes_runtime get_magic_quotes_gpc get_magic_quotes_runtime import_request_variables error_log serialize unserialize memory_get_usage var_dump var_export debug_zval_dump print_r highlight_file show_source highlight_string ini_get ini_get_all ini_set ini_alter ini_restore get_include_path set_include_path restore_include_path setcookie header headers_sent connection_aborted connection_status ignore_user_abort parse_ini_file is_uploaded_file move_uploaded_file intval floatval doubleval strval gettype settype is_null is_resource is_bool is_long is_float is_int is_integer is_double is_real is_numeric is_string is_array is_object is_scalar ereg ereg_replace eregi eregi_replace split spliti join sql_regcase dl pclose popen readfile rewind rmdir umask fclose feof fgetc fgets fgetss fread fopen fpassthru ftruncate fstat fseek ftell fflush fwrite fputs mkdir rename copy tempnam tmpfile file file_get_contents stream_select stream_context_create stream_context_set_params stream_context_set_option stream_context_get_options stream_filter_prepend stream_filter_append fgetcsv flock get_meta_tags stream_set_write_buffer set_file_buffer set_socket_blocking stream_set_blocking socket_set_blocking stream_get_meta_data stream_register_wrapper stream_wrapper_register stream_set_timeout socket_set_timeout socket_get_status realpath fnmatch fsockopen pfsockopen pack unpack get_browser crypt opendir closedir chdir getcwd rewinddir readdir dir glob fileatime filectime filegroup fileinode filemtime fileowner fileperms filesize filetype file_exists is_writable is_writeable is_readable is_executable is_file is_dir is_link stat lstat chown touch clearstatcache mail ob_start ob_flush ob_clean ob_end_flush ob_end_clean ob_get_flush ob_get_clean ob_get_length ob_get_level ob_get_status ob_get_contents ob_implicit_flush ob_list_handlers ksort krsort natsort natcasesort asort arsort sort rsort usort uasort uksort shuffle array_walk count end prev next reset current key min max in_array array_search extract compact array_fill range array_multisort array_push array_pop array_shift array_unshift array_splice array_slice array_merge array_merge_recursive array_keys array_values array_count_values array_reverse array_reduce array_pad array_flip array_change_key_case array_rand array_unique array_intersect array_intersect_assoc array_diff array_diff_assoc array_sum array_filter array_map array_chunk array_key_exists pos sizeof key_exists assert assert_options version_compare ftok str_rot13 aggregate session_name session_module_name session_save_path session_id session_regenerate_id session_decode session_register session_unregister session_is_registered session_encode session_start session_destroy session_unset session_set_save_handler session_cache_limiter session_cache_expire session_set_cookie_params session_get_cookie_params session_write_close preg_match preg_match_all preg_replace preg_replace_callback preg_split preg_quote preg_grep overload ctype_alnum ctype_alpha ctype_cntrl ctype_digit ctype_lower ctype_graph ctype_print ctype_punct ctype_space ctype_upper ctype_xdigit virtual apache_request_headers apache_note apache_lookup_uri apache_child_terminate apache_setenv apache_response_headers apache_get_version getallheaders mysql_connect mysql_pconnect mysql_close mysql_select_db mysql_create_db mysql_drop_db mysql_query mysql_unbuffered_query mysql_db_query mysql_list_dbs mysql_list_tables mysql_list_fields mysql_list_processes mysql_error mysql_errno mysql_affected_rows mysql_insert_id mysql_result mysql_num_rows mysql_num_fields mysql_fetch_row mysql_fetch_array mysql_fetch_assoc mysql_fetch_object mysql_data_seek mysql_fetch_lengths mysql_fetch_field mysql_field_seek mysql_free_result mysql_field_name mysql_field_table mysql_field_len mysql_field_type mysql_field_flags mysql_escape_string mysql_real_escape_string mysql_stat mysql_thread_id mysql_client_encoding mysql_get_client_info mysql_get_host_info mysql_get_proto_info mysql_get_server_info mysql_info mysql mysql_fieldname mysql_fieldtable mysql_fieldlen mysql_fieldtype mysql_fieldflags mysql_selectdb mysql_createdb mysql_dropdb mysql_freeresult mysql_numfields mysql_numrows mysql_listdbs mysql_listtables mysql_listfields mysql_db_name mysql_dbname mysql_tablename mysql_table_name pg_connect pg_pconnect pg_close pg_connection_status pg_connection_busy pg_connection_reset pg_host pg_dbname pg_port pg_tty pg_options pg_ping pg_query pg_send_query pg_cancel_query pg_fetch_result pg_fetch_row pg_fetch_assoc pg_fetch_array pg_fetch_object pg_fetch_all pg_affected_rows pg_get_result pg_result_seek pg_result_status pg_free_result pg_last_oid pg_num_rows pg_num_fields pg_field_name pg_field_num pg_field_size pg_field_type pg_field_prtlen pg_field_is_null pg_get_notify pg_get_pid pg_result_error pg_last_error pg_last_notice pg_put_line pg_end_copy pg_copy_to pg_copy_from pg_trace pg_untrace pg_lo_create pg_lo_unlink pg_lo_open pg_lo_close pg_lo_read pg_lo_write pg_lo_read_all pg_lo_import pg_lo_export pg_lo_seek pg_lo_tell pg_escape_string pg_escape_bytea pg_unescape_bytea pg_client_encoding pg_set_client_encoding pg_meta_data pg_convert pg_insert pg_update pg_delete pg_select pg_exec pg_getlastoid pg_cmdtuples pg_errormessage pg_numrows pg_numfields pg_fieldname pg_fieldsize pg_fieldtype pg_fieldnum pg_fieldprtlen pg_fieldisnull pg_freeresult pg_result pg_loreadall pg_locreate pg_lounlink pg_loopen pg_loclose pg_loread pg_lowrite pg_loimport pg_loexport echo print global static exit array empty eval isset unset die include require include_once require_once"), + multiLineStrings: true, + hooks: { + "$": function(stream) { + stream.eatWhile(/[\w\$_]/); + return "variable-2"; + }, + "<": function(stream, state) { + if (stream.match(/<", false)) stream.next(); + return "comment"; + }, + "/": function(stream) { + if (stream.eat("/")) { + while (!stream.eol() && !stream.match("?>", false)) stream.next(); + return "comment"; + } + return false; + } + } + }; + + CodeMirror.defineMode("php", function(config, parserConfig) { + var htmlMode = CodeMirror.getMode(config, "text/html"); + var phpMode = CodeMirror.getMode(config, phpConfig); + + function dispatch(stream, state) { + var isPHP = state.curMode == phpMode; + if (stream.sol() && state.pending != '"') state.pending = null; + if (!isPHP) { + if (stream.match(/^<\?\w*/)) { + state.curMode = phpMode; + state.curState = state.php; + return "meta"; + } + if (state.pending == '"') { + while (!stream.eol() && stream.next() != '"') {} + var style = "string"; + } else if (state.pending && stream.pos < state.pending.end) { + stream.pos = state.pending.end; + var style = state.pending.style; + } else { + var style = htmlMode.token(stream, state.curState); + } + state.pending = null; + var cur = stream.current(), openPHP = cur.search(/<\?/); + if (openPHP != -1) { + if (style == "string" && /\"$/.test(cur) && !/\?>/.test(cur)) state.pending = '"'; + else state.pending = {end: stream.pos, style: style}; + stream.backUp(cur.length - openPHP); + } + return style; + } else if (isPHP && state.php.tokenize == null && stream.match("?>")) { + state.curMode = htmlMode; + state.curState = state.html; + return "meta"; + } else { + return phpMode.token(stream, state.curState); + } + } + + return { + startState: function() { + var html = CodeMirror.startState(htmlMode), php = CodeMirror.startState(phpMode); + return {html: html, + php: php, + curMode: parserConfig.startOpen ? phpMode : htmlMode, + curState: parserConfig.startOpen ? php : html, + pending: null}; + }, + + copyState: function(state) { + var html = state.html, htmlNew = CodeMirror.copyState(htmlMode, html), + php = state.php, phpNew = CodeMirror.copyState(phpMode, php), cur; + if (state.curMode == htmlMode) cur = htmlNew; + else cur = phpNew; + return {html: htmlNew, php: phpNew, curMode: state.curMode, curState: cur, + pending: state.pending}; + }, + + token: dispatch, + + indent: function(state, textAfter) { + if ((state.curMode != phpMode && /^\s*<\//.test(textAfter)) || + (state.curMode == phpMode && /^\?>/.test(textAfter))) + return htmlMode.indent(state.html, textAfter); + return state.curMode.indent(state.curState, textAfter); + }, + + electricChars: "/{}:", + blockCommentStart: "/*", + blockCommentEnd: "*/", + lineComment: "//", + + innerMode: function(state) { return {state: state.curState, mode: state.curMode}; } + }; + }, "htmlmixed", "clike"); + + CodeMirror.defineMIME("application/x-httpd-php", "php"); + CodeMirror.defineMIME("application/x-httpd-php-open", {name: "php", startOpen: true}); + CodeMirror.defineMIME("text/x-php", phpConfig); +})(); diff --git a/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/pig/index.html b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/pig/index.html new file mode 100644 index 000000000..1b0c60267 --- /dev/null +++ b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/pig/index.html @@ -0,0 +1,42 @@ + + + + + CodeMirror: Pig Latin mode + + + + + + + +

CodeMirror: Pig Latin mode

+ +
+ + + +

+ Simple mode that handles Pig Latin language. +

+ +

MIME type defined: text/x-pig + (PIG code) + diff --git a/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/pig/pig.js b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/pig/pig.js new file mode 100644 index 000000000..304a733a8 --- /dev/null +++ b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/pig/pig.js @@ -0,0 +1,171 @@ +/* + * Pig Latin Mode for CodeMirror 2 + * @author Prasanth Jayachandran + * @link https://github.com/prasanthj/pig-codemirror-2 + * This implementation is adapted from PL/SQL mode in CodeMirror 2. + */ +CodeMirror.defineMode("pig", function(_config, parserConfig) { + var keywords = parserConfig.keywords, + builtins = parserConfig.builtins, + types = parserConfig.types, + multiLineStrings = parserConfig.multiLineStrings; + + var isOperatorChar = /[*+\-%<>=&?:\/!|]/; + + function chain(stream, state, f) { + state.tokenize = f; + return f(stream, state); + } + + var type; + function ret(tp, style) { + type = tp; + return style; + } + + function tokenComment(stream, state) { + var isEnd = false; + var ch; + while(ch = stream.next()) { + if(ch == "/" && isEnd) { + state.tokenize = tokenBase; + break; + } + isEnd = (ch == "*"); + } + return ret("comment", "comment"); + } + + 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 = tokenBase; + return ret("string", "error"); + }; + } + + function tokenBase(stream, state) { + var ch = stream.next(); + + // is a start of string? + if (ch == '"' || ch == "'") + return chain(stream, state, tokenString(ch)); + // is it one of the special chars + else if(/[\[\]{}\(\),;\.]/.test(ch)) + return ret(ch); + // is it a number? + else if(/\d/.test(ch)) { + stream.eatWhile(/[\w\.]/); + return ret("number", "number"); + } + // multi line comment or operator + else if (ch == "/") { + if (stream.eat("*")) { + return chain(stream, state, tokenComment); + } + else { + stream.eatWhile(isOperatorChar); + return ret("operator", "operator"); + } + } + // single line comment or operator + else if (ch=="-") { + if(stream.eat("-")){ + stream.skipToEnd(); + return ret("comment", "comment"); + } + else { + stream.eatWhile(isOperatorChar); + return ret("operator", "operator"); + } + } + // is it an operator + else if (isOperatorChar.test(ch)) { + stream.eatWhile(isOperatorChar); + return ret("operator", "operator"); + } + else { + // get the while word + stream.eatWhile(/[\w\$_]/); + // is it one of the listed keywords? + if (keywords && keywords.propertyIsEnumerable(stream.current().toUpperCase())) { + if (stream.eat(")") || stream.eat(".")) { + //keywords can be used as variables like flatten(group), group.$0 etc.. + } + else { + return ("keyword", "keyword"); + } + } + // is it one of the builtin functions? + if (builtins && builtins.propertyIsEnumerable(stream.current().toUpperCase())) + { + return ("keyword", "variable-2"); + } + // is it one of the listed types? + if (types && types.propertyIsEnumerable(stream.current().toUpperCase())) + return ("keyword", "variable-3"); + // default is a 'variable' + return ret("variable", "pig-word"); + } + } + + // Interface + return { + startState: function() { + return { + tokenize: tokenBase, + startOfLine: true + }; + }, + + token: function(stream, state) { + if(stream.eatSpace()) return null; + var style = state.tokenize(stream, state); + return style; + } + }; +}); + +(function() { + function keywords(str) { + var obj = {}, words = str.split(" "); + for (var i = 0; i < words.length; ++i) obj[words[i]] = true; + return obj; + } + + // builtin funcs taken from trunk revision 1303237 + var pBuiltins = "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 "; + + // taken from QueryLexer.g + var pKeywords = "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 "; + + // data types + var pTypes = "BOOLEAN INT LONG FLOAT DOUBLE CHARARRAY BYTEARRAY BAG TUPLE MAP "; + + CodeMirror.defineMIME("text/x-pig", { + name: "pig", + builtins: keywords(pBuiltins), + keywords: keywords(pKeywords), + tymixerp: keywords(pTypes) + }); +}()); diff --git a/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/properties/index.html b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/properties/index.html new file mode 100644 index 000000000..e21e02abd --- /dev/null +++ b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/properties/index.html @@ -0,0 +1,41 @@ + + + + + CodeMirror: Properties files mode + + + + + + + +

CodeMirror: Properties files mode

+
+ + +

MIME types defined: text/x-properties, + text/x-ini.

+ + + 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 :
    ^[\\(\\)\\[\\]\\{\\}@,:`=;\\.]
  • +
  • doubleOperators - RegEx - Regular Expression for double operators matching, default :
    ^((==)|(!=)|(<=)|(>=)|(<>)|(<<)|(>>)|(//)|(\\*\\*))
  • +
  • doubleDelimiters - RegEx - Regular Expressoin for double delimiters matching, default :
    ^((\\+=)|(\\-=)|(\\*=)|(%=)|(/=)|(&=)|(\\|=)|(\\^=))
  • +
  • tripleDelimiters - RegEx - Regular Expression for triple delimiters matching, default :
    ^((//=)|(>>=)|(<<=)|(\\*\\*=))
  • +
  • identifiers - RegEx - Regular Expression for identifier, default :
    ^[_A-Za-z][_A-Za-z0-9]*
  • +
+ + +

MIME types defined: text/x-python.

+ + diff --git a/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/python/python.js b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/python/python.js new file mode 100644 index 000000000..36a2047da --- /dev/null +++ b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/python/python.js @@ -0,0 +1,341 @@ +CodeMirror.defineMode("python", function(conf, parserConf) { + var ERRORCLASS = 'error'; + + function wordRegexp(words) { + return new RegExp("^((" + words.join(")|(") + "))\\b"); + } + + var singleOperators = parserConf.singleOperators || new RegExp("^[\\+\\-\\*/%&|\\^~<>!]"); + var singleDelimiters = parserConf.singleDelimiters || new RegExp('^[\\(\\)\\[\\]\\{\\}@,:`=;\\.]'); + var doubleOperators = parserConf.doubleOperators || new RegExp("^((==)|(!=)|(<=)|(>=)|(<>)|(<<)|(>>)|(//)|(\\*\\*))"); + var doubleDelimiters = parserConf.doubleDelimiters || new RegExp("^((\\+=)|(\\-=)|(\\*=)|(%=)|(/=)|(&=)|(\\|=)|(\\^=))"); + var tripleDelimiters = parserConf.tripleDelimiters || new RegExp("^((//=)|(>>=)|(<<=)|(\\*\\*=))"); + var identifiers = parserConf.identifiers|| new RegExp("^[_A-Za-z][_A-Za-z0-9]*"); + + var wordOperators = wordRegexp(['and', 'or', 'not', 'is', 'in']); + var commonkeywords = ['as', 'assert', 'break', 'class', 'continue', + 'def', 'del', 'elif', 'else', 'except', 'finally', + 'for', 'from', 'global', 'if', 'import', + 'lambda', 'pass', 'raise', 'return', + 'try', 'while', 'with', 'yield']; + var commonBuiltins = ['abs', 'all', 'any', 'bin', 'bool', 'bytearray', 'callable', 'chr', + 'classmethod', 'compile', 'complex', 'delattr', 'dict', 'dir', 'divmod', + 'enumerate', 'eval', 'filter', 'float', 'format', 'frozenset', + 'getattr', 'globals', 'hasattr', 'hash', 'help', 'hex', 'id', + 'input', 'int', 'isinstance', 'issubclass', 'iter', 'len', + 'list', 'locals', 'map', 'max', 'memoryview', 'min', 'next', + 'object', 'oct', 'open', 'ord', 'pow', 'property', 'range', + 'repr', 'reversed', 'round', 'set', 'setattr', 'slice', + 'sorted', 'staticmethod', 'str', 'sum', 'super', 'tuple', + 'type', 'vars', 'zip', '__import__', 'NotImplemented', + 'Ellipsis', '__debug__']; + var py2 = {'builtins': ['apply', 'basestring', 'buffer', 'cmp', 'coerce', 'execfile', + 'file', 'intern', 'long', 'raw_input', 'reduce', 'reload', + 'unichr', 'unicode', 'xrange', 'False', 'True', 'None'], + 'keywords': ['exec', 'print']}; + var py3 = {'builtins': ['ascii', 'bytes', 'exec', 'print'], + 'keywords': ['nonlocal', 'False', 'True', 'None']}; + + if (!!parserConf.version && parseInt(parserConf.version, 10) === 3) { + commonkeywords = commonkeywords.concat(py3.keywords); + commonBuiltins = commonBuiltins.concat(py3.builtins); + var stringPrefixes = new RegExp("^(([rb]|(br))?('{3}|\"{3}|['\"]))", "i"); + } else { + commonkeywords = commonkeywords.concat(py2.keywords); + commonBuiltins = commonBuiltins.concat(py2.builtins); + var stringPrefixes = new RegExp("^(([rub]|(ur)|(br))?('{3}|\"{3}|['\"]))", "i"); + } + var keywords = wordRegexp(commonkeywords); + var builtins = wordRegexp(commonBuiltins); + + var indentInfo = null; + + // tokenizers + function tokenBase(stream, state) { + // Handle scope changes + if (stream.sol()) { + var scopeOffset = state.scopes[0].offset; + if (stream.eatSpace()) { + var lineOffset = stream.indentation(); + if (lineOffset > scopeOffset) { + indentInfo = 'indent'; + } else if (lineOffset < scopeOffset) { + indentInfo = 'dedent'; + } + return null; + } else { + if (scopeOffset > 0) { + dedent(stream, state); + } + } + } + if (stream.eatSpace()) { + return null; + } + + var ch = stream.peek(); + + // Handle Comments + if (ch === '#') { + stream.skipToEnd(); + return 'comment'; + } + + // Handle Number Literals + if (stream.match(/^[0-9\.]/, false)) { + var floatLiteral = false; + // Floats + if (stream.match(/^\d*\.\d+(e[\+\-]?\d+)?/i)) { floatLiteral = true; } + if (stream.match(/^\d+\.\d*/)) { floatLiteral = true; } + if (stream.match(/^\.\d+/)) { floatLiteral = true; } + if (floatLiteral) { + // Float literals may be "imaginary" + stream.eat(/J/i); + return 'number'; + } + // Integers + var intLiteral = false; + // Hex + if (stream.match(/^0x[0-9a-f]+/i)) { intLiteral = true; } + // Binary + if (stream.match(/^0b[01]+/i)) { intLiteral = true; } + // Octal + if (stream.match(/^0o[0-7]+/i)) { intLiteral = true; } + // Decimal + if (stream.match(/^[1-9]\d*(e[\+\-]?\d+)?/)) { + // Decimal literals may be "imaginary" + stream.eat(/J/i); + // TODO - Can you have imaginary longs? + intLiteral = true; + } + // Zero by itself with no other piece of number. + if (stream.match(/^0(?![\dx])/i)) { intLiteral = true; } + if (intLiteral) { + // Integer literals may be "long" + stream.eat(/L/i); + return 'number'; + } + } + + // Handle Strings + if (stream.match(stringPrefixes)) { + state.tokenize = tokenStringFactory(stream.current()); + return state.tokenize(stream, state); + } + + // Handle operators and Delimiters + if (stream.match(tripleDelimiters) || stream.match(doubleDelimiters)) { + return null; + } + if (stream.match(doubleOperators) + || stream.match(singleOperators) + || stream.match(wordOperators)) { + return 'operator'; + } + if (stream.match(singleDelimiters)) { + return null; + } + + if (stream.match(keywords)) { + return 'keyword'; + } + + if (stream.match(builtins)) { + return 'builtin'; + } + + if (stream.match(identifiers)) { + return 'variable'; + } + + // Handle non-detected items + stream.next(); + return ERRORCLASS; + } + + function tokenStringFactory(delimiter) { + while ('rub'.indexOf(delimiter.charAt(0).toLowerCase()) >= 0) { + delimiter = delimiter.substr(1); + } + var singleline = delimiter.length == 1; + var OUTCLASS = 'string'; + + function tokenString(stream, state) { + while (!stream.eol()) { + stream.eatWhile(/[^'"\\]/); + if (stream.eat('\\')) { + stream.next(); + if (singleline && stream.eol()) { + return OUTCLASS; + } + } else if (stream.match(delimiter)) { + state.tokenize = tokenBase; + return OUTCLASS; + } else { + stream.eat(/['"]/); + } + } + if (singleline) { + if (parserConf.singleLineStringErrors) { + return ERRORCLASS; + } else { + state.tokenize = tokenBase; + } + } + return OUTCLASS; + } + tokenString.isString = true; + return tokenString; + } + + function indent(stream, state, type) { + type = type || 'py'; + var indentUnit = 0; + if (type === 'py') { + if (state.scopes[0].type !== 'py') { + state.scopes[0].offset = stream.indentation(); + return; + } + for (var i = 0; i < state.scopes.length; ++i) { + if (state.scopes[i].type === 'py') { + indentUnit = state.scopes[i].offset + conf.indentUnit; + break; + } + } + } else { + indentUnit = stream.column() + stream.current().length; + } + state.scopes.unshift({ + offset: indentUnit, + type: type + }); + } + + function dedent(stream, state, type) { + type = type || 'py'; + if (state.scopes.length == 1) return; + if (state.scopes[0].type === 'py') { + var _indent = stream.indentation(); + var _indent_index = -1; + for (var i = 0; i < state.scopes.length; ++i) { + if (_indent === state.scopes[i].offset) { + _indent_index = i; + break; + } + } + if (_indent_index === -1) { + return true; + } + while (state.scopes[0].offset !== _indent) { + state.scopes.shift(); + } + return false; + } else { + if (type === 'py') { + state.scopes[0].offset = stream.indentation(); + return false; + } else { + if (state.scopes[0].type != type) { + return true; + } + state.scopes.shift(); + return false; + } + } + } + + function tokenLexer(stream, state) { + indentInfo = null; + var style = state.tokenize(stream, state); + var current = stream.current(); + + // Handle '.' connected identifiers + if (current === '.') { + style = stream.match(identifiers, false) ? null : ERRORCLASS; + if (style === null && state.lastToken === 'meta') { + // Apply 'meta' style to '.' connected identifiers when + // appropriate. + style = 'meta'; + } + return style; + } + + // Handle decorators + if (current === '@') { + return stream.match(identifiers, false) ? 'meta' : ERRORCLASS; + } + + if ((style === 'variable' || style === 'builtin') + && state.lastToken === 'meta') { + style = 'meta'; + } + + // Handle scope changes. + if (current === 'pass' || current === 'return') { + state.dedent += 1; + } + if (current === 'lambda') state.lambda = true; + if ((current === ':' && !state.lambda && state.scopes[0].type == 'py') + || indentInfo === 'indent') { + indent(stream, state); + } + var delimiter_index = '[({'.indexOf(current); + if (delimiter_index !== -1) { + indent(stream, state, '])}'.slice(delimiter_index, delimiter_index+1)); + } + if (indentInfo === 'dedent') { + if (dedent(stream, state)) { + return ERRORCLASS; + } + } + delimiter_index = '])}'.indexOf(current); + if (delimiter_index !== -1) { + if (dedent(stream, state, current)) { + return ERRORCLASS; + } + } + if (state.dedent > 0 && stream.eol() && state.scopes[0].type == 'py') { + if (state.scopes.length > 1) state.scopes.shift(); + state.dedent -= 1; + } + + return style; + } + + var external = { + startState: function(basecolumn) { + return { + tokenize: tokenBase, + scomixerp: [{offset:basecolumn || 0, type:'py'}], + lastToken: null, + lambda: false, + dedent: 0 + }; + }, + + token: function(stream, state) { + var style = tokenLexer(stream, state); + + state.lastToken = style; + + if (stream.eol() && stream.lambda) { + state.lambda = false; + } + + return style; + }, + + indent: function(state) { + if (state.tokenize != tokenBase) { + return state.tokenize.isString ? CodeMirror.Pass : 0; + } + + return state.scopes[0].offset; + }, + + lineComment: "#" + }; + return external; +}); + +CodeMirror.defineMIME("text/x-python", "python"); diff --git a/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/q/index.html b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/q/index.html new file mode 100644 index 000000000..303ec1d3a --- /dev/null +++ b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/q/index.html @@ -0,0 +1,131 @@ + + + + + CodeMirror: Q mode + + + + + + + + +

CodeMirror: Q mode

+ +
+ + + +

MIME type defined: text/x-q.

+ + 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 + + + + + + + +

CodeMirror: RPM changes mode

+ +
+ + +

MIME types defined: text/x-rpm-changes.

+ + diff --git a/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/rpm/spec/index.html b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/rpm/spec/index.html new file mode 100644 index 000000000..8be98b63e --- /dev/null +++ b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/rpm/spec/index.html @@ -0,0 +1,99 @@ + + + + + CodeMirror: RPM spec mode + + + + + + + + +

CodeMirror: RPM spec mode

+ +
+ + +

MIME types defined: text/x-rpm-spec.

+ + 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/ruby/ruby.js b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/ruby/ruby.js new file mode 100644 index 000000000..af0ffe9e5 --- /dev/null +++ b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/ruby/ruby.js @@ -0,0 +1,247 @@ +CodeMirror.defineMode("ruby", function(config) { + function wordObj(words) { + var o = {}; + for (var i = 0, e = words.length; i < e; ++i) o[words[i]] = true; + return o; + } + var keywords = wordObj([ + "alias", "and", "BEGIN", "begin", "break", "case", "class", "def", "defined?", "do", "else", + "elsif", "END", "end", "ensure", "false", "for", "if", "in", "module", "next", "not", "or", + "redo", "rescue", "retry", "return", "self", "super", "then", "true", "undef", "unless", + "until", "when", "while", "yield", "nil", "raise", "throw", "catch", "fail", "loop", "callcc", + "caller", "lambda", "proc", "public", "protected", "private", "require", "load", + "require_relative", "extend", "autoload", "__END__", "__FILE__", "__LINE__", "__dir__" + ]); + var indentWords = wordObj(["def", "class", "case", "for", "while", "do", "module", "then", + "catch", "loop", "proc", "begin"]); + var dedentWords = wordObj(["end", "until"]); + var matching = {"[": "]", "{": "}", "(": ")"}; + var curPunc; + + function chain(newtok, stream, state) { + state.tokenize.push(newtok); + return newtok(stream, state); + } + + function tokenBase(stream, state) { + curPunc = null; + if (stream.sol() && stream.match("=begin") && stream.eol()) { + state.tokenize.push(readBlockComment); + return "comment"; + } + if (stream.eatSpace()) return null; + var ch = stream.next(), m; + if (ch == "`" || ch == "'" || ch == '"') { + return chain(readQuoted(ch, "string", ch == '"' || ch == "`"), stream, state); + } else if (ch == "/" && !stream.eol() && stream.peek() != " ") { + return chain(readQuoted(ch, "string-2", true), stream, state); + } else if (ch == "%") { + var style = "string", embed = false; + if (stream.eat("s")) style = "atom"; + else if (stream.eat(/[WQ]/)) { style = "string"; embed = true; } + else if (stream.eat(/[r]/)) { style = "string-2"; embed = true; } + else if (stream.eat(/[wxq]/)) style = "string"; + var delim = stream.eat(/[^\w\s]/); + if (!delim) return "operator"; + if (matching.propertyIsEnumerable(delim)) delim = matching[delim]; + return chain(readQuoted(delim, style, embed, true), stream, state); + } else if (ch == "#") { + stream.skipToEnd(); + return "comment"; + } else if (ch == "<" && (m = stream.match(/^<-?[\`\"\']?([a-zA-Z_?]\w*)[\`\"\']?(?:;|$)/))) { + return chain(readHereDoc(m[1]), stream, state); + } else if (ch == "0") { + if (stream.eat("x")) stream.eatWhile(/[\da-fA-F]/); + else if (stream.eat("b")) stream.eatWhile(/[01]/); + else stream.eatWhile(/[0-7]/); + return "number"; + } else if (/\d/.test(ch)) { + stream.match(/^[\d_]*(?:\.[\d_]+)?(?:[eE][+\-]?[\d_]+)?/); + return "number"; + } else if (ch == "?") { + while (stream.match(/^\\[CM]-/)) {} + if (stream.eat("\\")) stream.eatWhile(/\w/); + else stream.next(); + return "string"; + } else if (ch == ":") { + if (stream.eat("'")) return chain(readQuoted("'", "atom", false), stream, state); + if (stream.eat('"')) return chain(readQuoted('"', "atom", true), stream, state); + + // :> :>> :< :<< are valid symbols + if (stream.eat(/[\<\>]/)) { + stream.eat(/[\<\>]/); + return "atom"; + } + + // :+ :- :/ :* :| :& :! are valid symbols + if (stream.eat(/[\+\-\*\/\&\|\:\!]/)) { + return "atom"; + } + + // Symbols can't start by a digit + if (stream.eat(/[a-zA-Z$@_]/)) { + stream.eatWhile(/[\w]/); + // Only one ? ! = is allowed and only as the last character + stream.eat(/[\?\!\=]/); + return "atom"; + } + return "operator"; + } else if (ch == "@" && stream.match(/^@?[a-zA-Z_]/)) { + stream.eat("@"); + stream.eatWhile(/[\w]/); + return "variable-2"; + } else if (ch == "$") { + if (stream.eat(/[a-zA-Z_]/)) { + stream.eatWhile(/[\w]/); + } else if (stream.eat(/\d/)) { + stream.eat(/\d/); + } else { + stream.next(); // Must be a special global like $: or $! + } + return "variable-3"; + } else if (/[a-zA-Z_]/.test(ch)) { + stream.eatWhile(/[\w]/); + stream.eat(/[\?\!]/); + if (stream.eat(":")) return "atom"; + return "ident"; + } else if (ch == "|" && (state.varList || state.lastTok == "{" || state.lastTok == "do")) { + curPunc = "|"; + return null; + } else if (/[\(\)\[\]{}\\;]/.test(ch)) { + curPunc = ch; + return null; + } else if (ch == "-" && stream.eat(">")) { + return "arrow"; + } else if (/[=+\-\/*:\.^%<>~|]/.test(ch)) { + stream.eatWhile(/[=+\-\/*:\.^%<>~|]/); + return "operator"; + } else { + return null; + } + } + + function tokenBaseUntilBrace() { + var depth = 1; + return function(stream, state) { + if (stream.peek() == "}") { + depth--; + if (depth == 0) { + state.tokenize.pop(); + return state.tokenize[state.tokenize.length-1](stream, state); + } + } else if (stream.peek() == "{") { + depth++; + } + return tokenBase(stream, state); + }; + } + function tokenBaseOnce() { + var alreadyCalled = false; + return function(stream, state) { + if (alreadyCalled) { + state.tokenize.pop(); + return state.tokenize[state.tokenize.length-1](stream, state); + } + alreadyCalled = true; + return tokenBase(stream, state); + }; + } + function readQuoted(quote, style, embed, unescaped) { + return function(stream, state) { + var escaped = false, ch; + + if (state.context.type === 'read-quoted-paused') { + state.context = state.context.prev; + stream.eat("}"); + } + + while ((ch = stream.next()) != null) { + if (ch == quote && (unescaped || !escaped)) { + state.tokenize.pop(); + break; + } + if (embed && ch == "#" && !escaped) { + if (stream.eat("{")) { + if (quote == "}") { + state.context = {prev: state.context, type: 'read-quoted-paused'}; + } + state.tokenize.push(tokenBaseUntilBrace()); + break; + } else if (/[@\$]/.test(stream.peek())) { + state.tokenize.push(tokenBaseOnce()); + break; + } + } + escaped = !escaped && ch == "\\"; + } + return style; + }; + } + function readHereDoc(phrase) { + return function(stream, state) { + if (stream.match(phrase)) state.tokenize.pop(); + else stream.skipToEnd(); + return "string"; + }; + } + function readBlockComment(stream, state) { + if (stream.sol() && stream.match("=end") && stream.eol()) + state.tokenize.pop(); + stream.skipToEnd(); + return "comment"; + } + + return { + startState: function() { + return {tokenize: [tokenBase], + indented: 0, + context: {type: "top", indented: -config.indentUnit}, + continuedLine: false, + lastTok: null, + varList: false}; + }, + + token: function(stream, state) { + if (stream.sol()) state.indented = stream.indentation(); + var style = state.tokenize[state.tokenize.length-1](stream, state), kwtype; + if (style == "ident") { + var word = stream.current(); + style = keywords.propertyIsEnumerable(stream.current()) ? "keyword" + : /^[A-Z]/.test(word) ? "tag" + : (state.lastTok == "def" || state.lastTok == "class" || state.varList) ? "def" + : "variable"; + if (indentWords.propertyIsEnumerable(word)) kwtype = "indent"; + else if (dedentWords.propertyIsEnumerable(word)) kwtype = "dedent"; + else if ((word == "if" || word == "unless") && stream.column() == stream.indentation()) + kwtype = "indent"; + } + if (curPunc || (style && style != "comment")) state.lastTok = word || curPunc || style; + if (curPunc == "|") state.varList = !state.varList; + + if (kwtype == "indent" || /[\(\[\{]/.test(curPunc)) + state.context = {prev: state.context, type: curPunc || style, indented: state.indented}; + else if ((kwtype == "dedent" || /[\)\]\}]/.test(curPunc)) && state.context.prev) + state.context = state.context.prev; + + if (stream.eol()) + state.continuedLine = (curPunc == "\\" || style == "operator"); + return style; + }, + + indent: function(state, textAfter) { + if (state.tokenize[state.tokenize.length-1] != tokenBase) return 0; + var firstChar = textAfter && textAfter.charAt(0); + var ct = state.context; + var closing = ct.type == matching[firstChar] || + ct.type == "keyword" && /^(?:end|until|else|elsif|when|rescue)\b/.test(textAfter); + return ct.indented + (closing ? 0 : config.indentUnit) + + (state.continuedLine ? config.indentUnit : 0); + }, + + electricChars: "}de", // enD and rescuE + lineComment: "#" + }; +}); + +CodeMirror.defineMIME("text/x-ruby", "ruby"); + diff --git a/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/rust/index.html b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/rust/index.html new file mode 100644 index 000000000..a6d47fe84 --- /dev/null +++ b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/rust/index.html @@ -0,0 +1,48 @@ + + + + + CodeMirror: Rust mode + + + + + + + +

CodeMirror: Rust mode

+ +
+ + + +

MIME types defined: text/x-rustsrc.

+ + diff --git a/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/rust/rust.js b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/rust/rust.js new file mode 100644 index 000000000..7bee489b4 --- /dev/null +++ b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/rust/rust.js @@ -0,0 +1,435 @@ +CodeMirror.defineMode("rust", function() { + var indentUnit = 4, altIndentUnit = 2; + var valKeywords = { + "if": "if-style", "while": "if-style", "else": "else-style", + "do": "else-style", "ret": "else-style", "fail": "else-style", + "break": "atom", "cont": "atom", "const": "let", "resource": "fn", + "let": "let", "fn": "fn", "for": "for", "alt": "alt", "iface": "iface", + "impl": "impl", "type": "type", "enum": "enum", "mod": "mod", + "as": "op", "true": "atom", "false": "atom", "assert": "op", "check": "op", + "claim": "op", "native": "ignore", "unsafe": "ignore", "import": "else-style", + "export": "else-style", "copy": "op", "log": "op", "log_err": "op", + "use": "op", "bind": "op", "self": "atom" + }; + var typeKeywords = function() { + var keywords = {"fn": "fn", "block": "fn", "obj": "obj"}; + var atoms = "bool uint int i8 i16 i32 i64 u8 u16 u32 u64 float f32 f64 str char".split(" "); + for (var i = 0, e = atoms.length; i < e; ++i) keywords[atoms[i]] = "atom"; + return keywords; + }(); + var operatorChar = /[+\-*&%=<>!?|\.@]/; + + // Tokenizer + + // Used as scratch variable to communicate multiple values without + // consing up tons of objects. + var tcat, content; + function r(tc, style) { + tcat = tc; + return style; + } + + function tokenBase(stream, state) { + var ch = stream.next(); + if (ch == '"') { + state.tokenize = tokenString; + return state.tokenize(stream, state); + } + if (ch == "'") { + tcat = "atom"; + if (stream.eat("\\")) { + if (stream.skipTo("'")) { stream.next(); return "string"; } + else { return "error"; } + } else { + stream.next(); + return stream.eat("'") ? "string" : "error"; + } + } + if (ch == "/") { + if (stream.eat("/")) { stream.skipToEnd(); return "comment"; } + if (stream.eat("*")) { + state.tokenize = tokenComment(1); + return state.tokenize(stream, state); + } + } + if (ch == "#") { + if (stream.eat("[")) { tcat = "open-attr"; return null; } + stream.eatWhile(/\w/); + return r("macro", "meta"); + } + if (ch == ":" && stream.match(":<")) { + return r("op", null); + } + if (ch.match(/\d/) || (ch == "." && stream.eat(/\d/))) { + var flp = false; + if (!stream.match(/^x[\da-f]+/i) && !stream.match(/^b[01]+/)) { + stream.eatWhile(/\d/); + if (stream.eat(".")) { flp = true; stream.eatWhile(/\d/); } + if (stream.match(/^e[+\-]?\d+/i)) { flp = true; } + } + if (flp) stream.match(/^f(?:32|64)/); + else stream.match(/^[ui](?:8|16|32|64)/); + return r("atom", "number"); + } + if (ch.match(/[()\[\]{}:;,]/)) return r(ch, null); + if (ch == "-" && stream.eat(">")) return r("->", null); + if (ch.match(operatorChar)) { + stream.eatWhile(operatorChar); + return r("op", null); + } + stream.eatWhile(/\w/); + content = stream.current(); + if (stream.match(/^::\w/)) { + stream.backUp(1); + return r("prefix", "variable-2"); + } + if (state.keywords.propertyIsEnumerable(content)) + return r(state.keywords[content], content.match(/true|false/) ? "atom" : "keyword"); + return r("name", "variable"); + } + + function tokenString(stream, state) { + var ch, escaped = false; + while (ch = stream.next()) { + if (ch == '"' && !escaped) { + state.tokenize = tokenBase; + return r("atom", "string"); + } + escaped = !escaped && ch == "\\"; + } + // Hack to not confuse the parser when a string is split in + // pieces. + return r("op", "string"); + } + + function tokenComment(depth) { + return function(stream, state) { + var lastCh = null, ch; + while (ch = stream.next()) { + if (ch == "/" && lastCh == "*") { + if (depth == 1) { + state.tokenize = tokenBase; + break; + } else { + state.tokenize = tokenComment(depth - 1); + return state.tokenize(stream, state); + } + } + if (ch == "*" && lastCh == "/") { + state.tokenize = tokenComment(depth + 1); + return state.tokenize(stream, state); + } + lastCh = ch; + } + return "comment"; + }; + } + + // Parser + + var cx = {state: null, stream: null, marked: null, cc: null}; + function pass() { + for (var i = arguments.length - 1; i >= 0; i--) cx.cc.push(arguments[i]); + } + function cont() { + pass.apply(null, arguments); + return true; + } + + function pushlex(type, info) { + var result = function() { + var state = cx.state; + state.lexical = {indented: state.indented, column: cx.stream.column(), + type: type, prev: state.lexical, info: info}; + }; + result.lex = true; + return result; + } + function poplex() { + var state = cx.state; + if (state.lexical.prev) { + if (state.lexical.type == ")") + state.indented = state.lexical.indented; + state.lexical = state.lexical.prev; + } + } + function typecx() { cx.state.keywords = typeKeywords; } + function valcx() { cx.state.keywords = valKeywords; } + poplex.lex = typecx.lex = valcx.lex = true; + + function commasep(comb, end) { + function more(type) { + if (type == ",") return cont(comb, more); + if (type == end) return cont(); + return cont(more); + } + return function(type) { + if (type == end) return cont(); + return pass(comb, more); + }; + } + + function stat_of(comb, tag) { + return cont(pushlex("stat", tag), comb, poplex, block); + } + function block(type) { + if (type == "}") return cont(); + if (type == "let") return stat_of(letdef1, "let"); + if (type == "fn") return stat_of(fndef); + if (type == "type") return cont(pushlex("stat"), tydef, endstatement, poplex, block); + if (type == "enum") return stat_of(enumdef); + if (type == "mod") return stat_of(mod); + if (type == "iface") return stat_of(iface); + if (type == "impl") return stat_of(impl); + if (type == "open-attr") return cont(pushlex("]"), commasep(expression, "]"), poplex); + if (type == "ignore" || type.match(/[\]\);,]/)) return cont(block); + return pass(pushlex("stat"), expression, poplex, endstatement, block); + } + function endstatement(type) { + if (type == ";") return cont(); + return pass(); + } + function expression(type) { + if (type == "atom" || type == "name") return cont(maybeop); + if (type == "{") return cont(pushlex("}"), exprbrace, poplex); + if (type.match(/[\[\(]/)) return matchBrackets(type, expression); + if (type.match(/[\]\)\};,]/)) return pass(); + if (type == "if-style") return cont(expression, expression); + if (type == "else-style" || type == "op") return cont(expression); + if (type == "for") return cont(pattern, maybetype, inop, expression, expression); + if (type == "alt") return cont(expression, altbody); + if (type == "fn") return cont(fndef); + if (type == "macro") return cont(macro); + return cont(); + } + function maybeop(type) { + if (content == ".") return cont(maybeprop); + if (content == "::<"){return cont(typarams, maybeop);} + if (type == "op" || content == ":") return cont(expression); + if (type == "(" || type == "[") return matchBrackets(type, expression); + return pass(); + } + function maybeprop() { + if (content.match(/^\w+$/)) {cx.marked = "variable"; return cont(maybeop);} + return pass(expression); + } + function exprbrace(type) { + if (type == "op") { + if (content == "|") return cont(blockvars, poplex, pushlex("}", "block"), block); + if (content == "||") return cont(poplex, pushlex("}", "block"), block); + } + if (content == "mutable" || (content.match(/^\w+$/) && cx.stream.peek() == ":" + && !cx.stream.match("::", false))) + return pass(record_of(expression)); + return pass(block); + } + function record_of(comb) { + function ro(type) { + if (content == "mutable" || content == "with") {cx.marked = "keyword"; return cont(ro);} + if (content.match(/^\w*$/)) {cx.marked = "variable"; return cont(ro);} + if (type == ":") return cont(comb, ro); + if (type == "}") return cont(); + return cont(ro); + } + return ro; + } + function blockvars(type) { + if (type == "name") {cx.marked = "def"; return cont(blockvars);} + if (type == "op" && content == "|") return cont(); + return cont(blockvars); + } + + function letdef1(type) { + if (type.match(/[\]\)\};]/)) return cont(); + if (content == "=") return cont(expression, letdef2); + if (type == ",") return cont(letdef1); + return pass(pattern, maybetype, letdef1); + } + function letdef2(type) { + if (type.match(/[\]\)\};,]/)) return pass(letdef1); + else return pass(expression, letdef2); + } + function maybetype(type) { + if (type == ":") return cont(typecx, rtype, valcx); + return pass(); + } + function inop(type) { + if (type == "name" && content == "in") {cx.marked = "keyword"; return cont();} + return pass(); + } + function fndef(type) { + if (content == "@" || content == "~") {cx.marked = "keyword"; return cont(fndef);} + if (type == "name") {cx.marked = "def"; return cont(fndef);} + if (content == "<") return cont(typarams, fndef); + if (type == "{") return pass(expression); + if (type == "(") return cont(pushlex(")"), commasep(argdef, ")"), poplex, fndef); + if (type == "->") return cont(typecx, rtype, valcx, fndef); + if (type == ";") return cont(); + return cont(fndef); + } + function tydef(type) { + if (type == "name") {cx.marked = "def"; return cont(tydef);} + if (content == "<") return cont(typarams, tydef); + if (content == "=") return cont(typecx, rtype, valcx); + return cont(tydef); + } + function enumdef(type) { + if (type == "name") {cx.marked = "def"; return cont(enumdef);} + if (content == "<") return cont(typarams, enumdef); + if (content == "=") return cont(typecx, rtype, valcx, endstatement); + if (type == "{") return cont(pushlex("}"), typecx, enumblock, valcx, poplex); + return cont(enumdef); + } + function enumblock(type) { + if (type == "}") return cont(); + if (type == "(") return cont(pushlex(")"), commasep(rtype, ")"), poplex, enumblock); + if (content.match(/^\w+$/)) cx.marked = "def"; + return cont(enumblock); + } + function mod(type) { + if (type == "name") {cx.marked = "def"; return cont(mod);} + if (type == "{") return cont(pushlex("}"), block, poplex); + return pass(); + } + function iface(type) { + if (type == "name") {cx.marked = "def"; return cont(iface);} + if (content == "<") return cont(typarams, iface); + if (type == "{") return cont(pushlex("}"), block, poplex); + return pass(); + } + function impl(type) { + if (content == "<") return cont(typarams, impl); + if (content == "of" || content == "for") {cx.marked = "keyword"; return cont(rtype, impl);} + if (type == "name") {cx.marked = "def"; return cont(impl);} + if (type == "{") return cont(pushlex("}"), block, poplex); + return pass(); + } + function typarams() { + if (content == ">") return cont(); + if (content == ",") return cont(typarams); + if (content == ":") return cont(rtype, typarams); + return pass(rtype, typarams); + } + function argdef(type) { + if (type == "name") {cx.marked = "def"; return cont(argdef);} + if (type == ":") return cont(typecx, rtype, valcx); + return pass(); + } + function rtype(type) { + if (type == "name") {cx.marked = "variable-3"; return cont(rtypemaybeparam); } + if (content == "mutable") {cx.marked = "keyword"; return cont(rtype);} + if (type == "atom") return cont(rtypemaybeparam); + if (type == "op" || type == "obj") return cont(rtype); + if (type == "fn") return cont(fntype); + if (type == "{") return cont(pushlex("{"), record_of(rtype), poplex); + return matchBrackets(type, rtype); + } + function rtypemaybeparam() { + if (content == "<") return cont(typarams); + return pass(); + } + function fntype(type) { + if (type == "(") return cont(pushlex("("), commasep(rtype, ")"), poplex, fntype); + if (type == "->") return cont(rtype); + return pass(); + } + function pattern(type) { + if (type == "name") {cx.marked = "def"; return cont(patternmaybeop);} + if (type == "atom") return cont(patternmaybeop); + if (type == "op") return cont(pattern); + if (type.match(/[\]\)\};,]/)) return pass(); + return matchBrackets(type, pattern); + } + function patternmaybeop(type) { + if (type == "op" && content == ".") return cont(); + if (content == "to") {cx.marked = "keyword"; return cont(pattern);} + else return pass(); + } + function altbody(type) { + if (type == "{") return cont(pushlex("}", "alt"), altblock1, poplex); + return pass(); + } + function altblock1(type) { + if (type == "}") return cont(); + if (type == "|") return cont(altblock1); + if (content == "when") {cx.marked = "keyword"; return cont(expression, altblock2);} + if (type.match(/[\]\);,]/)) return cont(altblock1); + return pass(pattern, altblock2); + } + function altblock2(type) { + if (type == "{") return cont(pushlex("}", "alt"), block, poplex, altblock1); + else return pass(altblock1); + } + + function macro(type) { + if (type.match(/[\[\(\{]/)) return matchBrackets(type, expression); + return pass(); + } + function matchBrackets(type, comb) { + if (type == "[") return cont(pushlex("]"), commasep(comb, "]"), poplex); + if (type == "(") return cont(pushlex(")"), commasep(comb, ")"), poplex); + if (type == "{") return cont(pushlex("}"), commasep(comb, "}"), poplex); + return cont(); + } + + function parse(state, stream, style) { + var cc = state.cc; + // Communicate our context to the combinators. + // (Less wasteful than consing up a hundred closures on every call.) + cx.state = state; cx.stream = stream; cx.marked = null, cx.cc = cc; + + while (true) { + var combinator = cc.length ? cc.pop() : block; + if (combinator(tcat)) { + while(cc.length && cc[cc.length - 1].lex) + cc.pop()(); + return cx.marked || style; + } + } + } + + return { + startState: function() { + return { + tokenize: tokenBase, + cc: [], + lexical: {indented: -indentUnit, column: 0, type: "top", align: false}, + keywords: valKeywords, + indented: 0 + }; + }, + + token: function(stream, state) { + if (stream.sol()) { + if (!state.lexical.hasOwnProperty("align")) + state.lexical.align = false; + state.indented = stream.indentation(); + } + if (stream.eatSpace()) return null; + tcat = content = null; + var style = state.tokenize(stream, state); + if (style == "comment") return style; + if (!state.lexical.hasOwnProperty("align")) + state.lexical.align = true; + if (tcat == "prefix") return style; + if (!content) content = stream.current(); + return parse(state, stream, style); + }, + + indent: function(state, textAfter) { + if (state.tokenize != tokenBase) return 0; + var firstChar = textAfter && textAfter.charAt(0), lexical = state.lexical, + type = lexical.type, closing = firstChar == type; + if (type == "stat") return lexical.indented + indentUnit; + if (lexical.align) return lexical.column + (closing ? 0 : 1); + return lexical.indented + (closing ? 0 : (lexical.info == "alt" ? altIndentUnit : indentUnit)); + }, + + electricChars: "{}", + blockCommentStart: "/*", + blockCommentEnd: "*/", + lineComment: "//" + }; +}); + +CodeMirror.defineMIME("text/x-rustsrc", "rust"); diff --git a/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/sass/index.html b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/sass/index.html new file mode 100644 index 000000000..3af7bff9e --- /dev/null +++ b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/sass/index.html @@ -0,0 +1,54 @@ + + + + + CodeMirror: Sass mode + + + + + + + + +

CodeMirror: Sass mode

+
+ + +

MIME types defined: text/x-sass.

+ + diff --git a/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/sass/sass.js b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/sass/sass.js new file mode 100644 index 000000000..e5a1c2ad7 --- /dev/null +++ b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/sass/sass.js @@ -0,0 +1,330 @@ +CodeMirror.defineMode("sass", function(config) { + var tokenRegexp = function(words){ + return new RegExp("^" + words.join("|")); + }; + + var keywords = ["true", "false", "null", "auto"]; + var keywordsRegexp = new RegExp("^" + keywords.join("|")); + + var operators = ["\\(", "\\)", "=", ">", "<", "==", ">=", "<=", "\\+", "-", "\\!=", "/", "\\*", "%", "and", "or", "not"]; + var opRegexp = tokenRegexp(operators); + + var pseudoElementsRegexp = /^::?[\w\-]+/; + + var urlTokens = function(stream, state){ + var ch = stream.peek(); + + if (ch === ")"){ + stream.next(); + state.tokenizer = tokenBase; + return "operator"; + }else if (ch === "("){ + stream.next(); + stream.eatSpace(); + + return "operator"; + }else if (ch === "'" || ch === '"'){ + state.tokenizer = buildStringTokenizer(stream.next()); + return "string"; + }else{ + state.tokenizer = buildStringTokenizer(")", false); + return "string"; + } + }; + var multilineComment = function(stream, state) { + if (stream.skipTo("*/")){ + stream.next(); + stream.next(); + state.tokenizer = tokenBase; + }else { + stream.next(); + } + + return "comment"; + }; + + var buildStringTokenizer = function(quote, greedy){ + if(greedy == null){ greedy = true; } + + function stringTokenizer(stream, state){ + var nextChar = stream.next(); + var peekChar = stream.peek(); + var previousChar = stream.string.charAt(stream.pos-2); + + var endingString = ((nextChar !== "\\" && peekChar === quote) || (nextChar === quote && previousChar !== "\\")); + + /* + console.log("previousChar: " + previousChar); + console.log("nextChar: " + nextChar); + console.log("peekChar: " + peekChar); + console.log("ending: " + endingString); + */ + + if (endingString){ + if (nextChar !== quote && greedy) { stream.next(); } + state.tokenizer = tokenBase; + return "string"; + }else if (nextChar === "#" && peekChar === "{"){ + state.tokenizer = buildInterpolationTokenizer(stringTokenizer); + stream.next(); + return "operator"; + }else { + return "string"; + } + } + + return stringTokenizer; + }; + + var buildInterpolationTokenizer = function(currentTokenizer){ + return function(stream, state){ + if (stream.peek() === "}"){ + stream.next(); + state.tokenizer = currentTokenizer; + return "operator"; + }else{ + return tokenBase(stream, state); + } + }; + }; + + var indent = function(state){ + if (state.indentCount == 0){ + state.indentCount++; + var lastScopeOffset = state.scopes[0].offset; + var currentOffset = lastScopeOffset + config.indentUnit; + state.scopes.unshift({ offset:currentOffset }); + } + }; + + var dedent = function(state){ + if (state.scopes.length == 1) { return; } + + state.scopes.shift(); + }; + + var tokenBase = function(stream, state) { + var ch = stream.peek(); + + // Single line Comment + if (stream.match('//')) { + stream.skipToEnd(); + return "comment"; + } + + // Multiline Comment + if (stream.match('/*')){ + state.tokenizer = multilineComment; + return state.tokenizer(stream, state); + } + + // Interpolation + if (stream.match('#{')){ + state.tokenizer = buildInterpolationTokenizer(tokenBase); + return "operator"; + } + + if (ch === "."){ + stream.next(); + + // Match class selectors + if (stream.match(/^[\w-]+/)){ + indent(state); + return "atom"; + }else if (stream.peek() === "#"){ + indent(state); + return "atom"; + }else{ + return "operator"; + } + } + + if (ch === "#"){ + stream.next(); + + // Hex numbers + if (stream.match(/[0-9a-fA-F]{6}|[0-9a-fA-F]{3}/)){ + return "number"; + } + + // ID selectors + if (stream.match(/^[\w-]+/)){ + indent(state); + return "atom"; + } + + if (stream.peek() === "#"){ + indent(state); + return "atom"; + } + } + + // Numbers + if (stream.match(/^-?[0-9\.]+/)){ + return "number"; + } + + // Units + if (stream.match(/^(px|em|in)\b/)){ + return "unit"; + } + + if (stream.match(keywordsRegexp)){ + return "keyword"; + } + + if (stream.match(/^url/) && stream.peek() === "("){ + state.tokenizer = urlTokens; + return "atom"; + } + + // Variables + if (ch === "$"){ + stream.next(); + stream.eatWhile(/[\w-]/); + + if (stream.peek() === ":"){ + stream.next(); + return "variable-2"; + }else{ + return "variable-3"; + } + } + + if (ch === "!"){ + stream.next(); + + if (stream.match(/^[\w]+/)){ + return "keyword"; + } + + return "operator"; + } + + if (ch === "="){ + stream.next(); + + // Match shortcut mixin definition + if (stream.match(/^[\w-]+/)){ + indent(state); + return "meta"; + }else { + return "operator"; + } + } + + if (ch === "+"){ + stream.next(); + + // Match shortcut mixin definition + if (stream.match(/^[\w-]+/)){ + return "variable-3"; + }else { + return "operator"; + } + } + + // Indent Directives + if (stream.match(/^@(else if|if|media|else|for|each|while|mixin|function)/)){ + indent(state); + return "meta"; + } + + // Other Directives + if (ch === "@"){ + stream.next(); + stream.eatWhile(/[\w-]/); + return "meta"; + } + + // Strings + if (ch === '"' || ch === "'"){ + stream.next(); + state.tokenizer = buildStringTokenizer(ch); + return "string"; + } + + // Pseudo element selectors + if (ch == ':' && stream.match(pseudoElementsRegexp)){ + return "keyword"; + } + + // atoms + if (stream.eatWhile(/[\w-&]/)){ + // matches a property definition + if (stream.peek() === ":" && !stream.match(pseudoElementsRegexp, false)) + return "property"; + else + return "atom"; + } + + if (stream.match(opRegexp)){ + return "operator"; + } + + // If we haven't returned by now, we move 1 character + // and return an error + stream.next(); + return null; + }; + + var tokenLexer = function(stream, state) { + if (stream.sol()){ + state.indentCount = 0; + } + var style = state.tokenizer(stream, state); + var current = stream.current(); + + if (current === "@return"){ + dedent(state); + } + + if (style === "atom"){ + indent(state); + } + + if (style !== null){ + var startOfToken = stream.pos - current.length; + var withCurrentIndent = startOfToken + (config.indentUnit * state.indentCount); + + var newScopes = []; + + for (var i = 0; i < state.scopes.length; i++){ + var scope = state.scopes[i]; + + if (scope.offset <= withCurrentIndent){ + newScopes.push(scope); + } + } + + state.scopes = newScopes; + } + + + return style; + }; + + return { + startState: function() { + return { + tokenizer: tokenBase, + scomixerp: [{offset: 0, type: 'sass'}], + definedVars: [], + definedMixins: [] + }; + }, + token: function(stream, state) { + var style = tokenLexer(stream, state); + + state.lastToken = { style: style, content: stream.current() }; + + return style; + }, + + indent: function(state) { + return state.scopes[0].offset; + } + }; +}); + +CodeMirror.defineMIME("text/x-sass", "sass"); diff --git a/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/scheme/index.html b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/scheme/index.html new file mode 100644 index 000000000..5936a0241 --- /dev/null +++ b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/scheme/index.html @@ -0,0 +1,65 @@ + + + + + CodeMirror: Scheme mode + + + + + + + +

CodeMirror: Scheme mode

+
+ + +

MIME types defined: text/x-scheme.

+ + + diff --git a/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/scheme/scheme.js b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/scheme/scheme.js new file mode 100644 index 000000000..c5990ae92 --- /dev/null +++ b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/scheme/scheme.js @@ -0,0 +1,232 @@ +/** + * Author: Koh Zi Han, based on implementation by Koh Zi Chun + */ +CodeMirror.defineMode("scheme", function () { + var BUILTIN = "builtin", COMMENT = "comment", STRING = "string", + ATOM = "atom", NUMBER = "number", BRACKET = "bracket"; + var INDENT_WORD_SKIP = 2; + + function makeKeywords(str) { + var obj = {}, words = str.split(" "); + for (var i = 0; i < words.length; ++i) obj[words[i]] = true; + return obj; + } + + var keywords = makeKeywords("λ case-lambda call/cc class define-class exit-handler field import inherit init-field interface let*-values let-values let/ec mixin opt-lambda override protect provide public rename require require-for-syntax syntax syntax-case syntax-error unit/sig unless when with-syntax and begin call-with-current-continuation call-with-input-file call-with-output-file case cond define define-syntax delay do dynamic-wind else for-each if lambda let let* let-syntax letrec letrec-syntax map or syntax-rules abs acos angle append apply asin assoc assq assv atan boolean? caar cadr call-with-input-file call-with-output-file call-with-values car cdddar cddddr cdr ceiling char->integer char-alphabetic? char-ci<=? char-ci=? char-ci>? char-downcase char-lower-case? char-numeric? char-ready? char-upcase char-upper-case? char-whitespace? char<=? char=? char>? char? close-input-port close-output-port complex? cons cos current-input-port current-output-port denominator display eof-object? eq? equal? eqv? eval even? exact->inexact exact? exp expt #f floor force gcd imag-part inexact->exact inexact? input-port? integer->char integer? interaction-environment lcm length list list->string list->vector list-ref list-tail list? load log magnitude make-polar make-rectangular make-string make-vector max member memq memv min modulo negative? newline not null-environment null? number->string number? numerator odd? open-input-file open-output-file output-port? pair? peek-char port? positive? procedure? quasiquote quote quotient rational? rationalize read read-char real-part real? remainder reverse round scheme-report-environment set! set-car! set-cdr! sin sqrt string string->list string->number string->symbol string-append string-ci<=? string-ci=? string-ci>? string-copy string-fill! string-length string-ref string-set! string<=? string=? string>? string? substring symbol->string symbol? #t tan transcript-off transcript-on truncate values vector vector->list vector-fill! vector-length vector-ref vector-set! with-input-from-file with-output-to-file write write-char zero?"); + var indentKeys = makeKeywords("define let letrec let* lambda"); + + function stateStack(indent, type, prev) { // represents a state stack object + this.indent = indent; + this.type = type; + this.prev = prev; + } + + function pushStack(state, indent, type) { + state.indentStack = new stateStack(indent, type, state.indentStack); + } + + function popStack(state) { + state.indentStack = state.indentStack.prev; + } + + var binaryMatcher = new RegExp(/^(?:[-+]i|[-+][01]+#*(?:\/[01]+#*)?i|[-+]?[01]+#*(?:\/[01]+#*)?@[-+]?[01]+#*(?:\/[01]+#*)?|[-+]?[01]+#*(?:\/[01]+#*)?[-+](?:[01]+#*(?:\/[01]+#*)?)?i|[-+]?[01]+#*(?:\/[01]+#*)?)(?=[()\s;"]|$)/i); + var octalMatcher = new RegExp(/^(?:[-+]i|[-+][0-7]+#*(?:\/[0-7]+#*)?i|[-+]?[0-7]+#*(?:\/[0-7]+#*)?@[-+]?[0-7]+#*(?:\/[0-7]+#*)?|[-+]?[0-7]+#*(?:\/[0-7]+#*)?[-+](?:[0-7]+#*(?:\/[0-7]+#*)?)?i|[-+]?[0-7]+#*(?:\/[0-7]+#*)?)(?=[()\s;"]|$)/i); + var hexMatcher = new RegExp(/^(?:[-+]i|[-+][\da-f]+#*(?:\/[\da-f]+#*)?i|[-+]?[\da-f]+#*(?:\/[\da-f]+#*)?@[-+]?[\da-f]+#*(?:\/[\da-f]+#*)?|[-+]?[\da-f]+#*(?:\/[\da-f]+#*)?[-+](?:[\da-f]+#*(?:\/[\da-f]+#*)?)?i|[-+]?[\da-f]+#*(?:\/[\da-f]+#*)?)(?=[()\s;"]|$)/i); + var decimalMatcher = new RegExp(/^(?:[-+]i|[-+](?:(?:(?:\d+#+\.?#*|\d+\.\d*#*|\.\d+#*|\d+)(?:[esfdl][-+]?\d+)?)|\d+#*\/\d+#*)i|[-+]?(?:(?:(?:\d+#+\.?#*|\d+\.\d*#*|\.\d+#*|\d+)(?:[esfdl][-+]?\d+)?)|\d+#*\/\d+#*)@[-+]?(?:(?:(?:\d+#+\.?#*|\d+\.\d*#*|\.\d+#*|\d+)(?:[esfdl][-+]?\d+)?)|\d+#*\/\d+#*)|[-+]?(?:(?:(?:\d+#+\.?#*|\d+\.\d*#*|\.\d+#*|\d+)(?:[esfdl][-+]?\d+)?)|\d+#*\/\d+#*)[-+](?:(?:(?:\d+#+\.?#*|\d+\.\d*#*|\.\d+#*|\d+)(?:[esfdl][-+]?\d+)?)|\d+#*\/\d+#*)?i|(?:(?:(?:\d+#+\.?#*|\d+\.\d*#*|\.\d+#*|\d+)(?:[esfdl][-+]?\d+)?)|\d+#*\/\d+#*))(?=[()\s;"]|$)/i); + + function isBinaryNumber (stream) { + return stream.match(binaryMatcher); + } + + function isOctalNumber (stream) { + return stream.match(octalMatcher); + } + + function isDecimalNumber (stream, backup) { + if (backup === true) { + stream.backUp(1); + } + return stream.match(decimalMatcher); + } + + function isHexNumber (stream) { + return stream.match(hexMatcher); + } + + return { + startState: function () { + return { + indentStack: null, + indentation: 0, + mode: false, + sExprComment: false + }; + }, + + token: function (stream, state) { + if (state.indentStack == null && stream.sol()) { + // update indentation, but only if indentStack is empty + state.indentation = stream.indentation(); + } + + // skip spaces + if (stream.eatSpace()) { + return null; + } + var returnType = null; + + switch(state.mode){ + case "string": // multi-line string parsing mode + var next, escaped = false; + while ((next = stream.next()) != null) { + if (next == "\"" && !escaped) { + + state.mode = false; + break; + } + escaped = !escaped && next == "\\"; + } + returnType = STRING; // continue on in scheme-string mode + break; + case "comment": // comment parsing mode + var next, maybeEnd = false; + while ((next = stream.next()) != null) { + if (next == "#" && maybeEnd) { + + state.mode = false; + break; + } + maybeEnd = (next == "|"); + } + returnType = COMMENT; + break; + case "s-expr-comment": // s-expr commenting mode + state.mode = false; + if(stream.peek() == "(" || stream.peek() == "["){ + // actually start scheme s-expr commenting mode + state.sExprComment = 0; + }else{ + // if not we just comment the entire of the next token + stream.eatWhile(/[^/s]/); // eat non spaces + returnType = COMMENT; + break; + } + default: // default parsing mode + var ch = stream.next(); + + if (ch == "\"") { + state.mode = "string"; + returnType = STRING; + + } else if (ch == "'") { + returnType = ATOM; + } else if (ch == '#') { + if (stream.eat("|")) { // Multi-line comment + state.mode = "comment"; // toggle to comment mode + returnType = COMMENT; + } else if (stream.eat(/[tf]/i)) { // #t/#f (atom) + returnType = ATOM; + } else if (stream.eat(';')) { // S-Expr comment + state.mode = "s-expr-comment"; + returnType = COMMENT; + } else { + var numTest = null, hasExactness = false, hasRadix = true; + if (stream.eat(/[ei]/i)) { + hasExactness = true; + } else { + stream.backUp(1); // must be radix specifier + } + if (stream.match(/^#b/i)) { + numTest = isBinaryNumber; + } else if (stream.match(/^#o/i)) { + numTest = isOctalNumber; + } else if (stream.match(/^#x/i)) { + numTest = isHexNumber; + } else if (stream.match(/^#d/i)) { + numTest = isDecimalNumber; + } else if (stream.match(/^[-+0-9.]/, false)) { + hasRadix = false; + numTest = isDecimalNumber; + // re-consume the intial # if all matches failed + } else if (!hasExactness) { + stream.eat('#'); + } + if (numTest != null) { + if (hasRadix && !hasExactness) { + // consume optional exactness after radix + stream.match(/^#[ei]/i); + } + if (numTest(stream)) + returnType = NUMBER; + } + } + } else if (/^[-+0-9.]/.test(ch) && isDecimalNumber(stream, true)) { // match non-prefixed number, must be decimal + returnType = NUMBER; + } else if (ch == ";") { // comment + stream.skipToEnd(); // rest of the line is a comment + returnType = COMMENT; + } else if (ch == "(" || ch == "[") { + var keyWord = ''; var indentTemp = stream.column(), letter; + /** + Either + (indent-word .. + (non-indent-word .. + (;something else, bracket, etc. + */ + + while ((letter = stream.eat(/[^\s\(\[\;\)\]]/)) != null) { + keyWord += letter; + } + + if (keyWord.length > 0 && indentKeys.propertyIsEnumerable(keyWord)) { // indent-word + + pushStack(state, indentTemp + INDENT_WORD_SKIP, ch); + } else { // non-indent word + // we continue eating the spaces + stream.eatSpace(); + if (stream.eol() || stream.peek() == ";") { + // nothing significant after + // we restart indentation 1 space after + pushStack(state, indentTemp + 1, ch); + } else { + pushStack(state, indentTemp + stream.current().length, ch); // else we match + } + } + stream.backUp(stream.current().length - 1); // undo all the eating + + if(typeof state.sExprComment == "number") state.sExprComment++; + + returnType = BRACKET; + } else if (ch == ")" || ch == "]") { + returnType = BRACKET; + if (state.indentStack != null && state.indentStack.type == (ch == ")" ? "(" : "[")) { + popStack(state); + + if(typeof state.sExprComment == "number"){ + if(--state.sExprComment == 0){ + returnType = COMMENT; // final closing bracket + state.sExprComment = false; // turn off s-expr commenting mode + } + } + } + } else { + stream.eatWhile(/[\w\$_\-!$%&*+\.\/:<=>?@\^~]/); + + if (keywords && keywords.propertyIsEnumerable(stream.current())) { + returnType = BUILTIN; + } else returnType = "variable"; + } + } + return (typeof state.sExprComment == "number") ? COMMENT : returnType; + }, + + indent: function (state) { + if (state.indentStack == null) return state.indentation; + return state.indentStack.indent; + }, + + lineComment: ";;" + }; +}); + +CodeMirror.defineMIME("text/x-scheme", "scheme"); diff --git a/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/shell/index.html b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/shell/index.html new file mode 100644 index 000000000..9a2ef7c4c --- /dev/null +++ b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/shell/index.html @@ -0,0 +1,51 @@ + + +CodeMirror: Shell mode + + + + + + + + + + +

CodeMirror: Shell mode

+ + + + + +

MIME types defined: text/x-sh.

diff --git a/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/shell/shell.js b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/shell/shell.js new file mode 100644 index 000000000..abfd21445 --- /dev/null +++ b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/shell/shell.js @@ -0,0 +1,118 @@ +CodeMirror.defineMode('shell', function() { + + var words = {}; + function define(style, string) { + var split = string.split(' '); + for(var i = 0; i < split.length; i++) { + words[split[i]] = style; + } + }; + + // Atoms + define('atom', 'true false'); + + // Keywords + define('keyword', 'if then do else elif while until for in esac fi fin ' + + 'fil done exit set unset export function'); + + // Commands + define('builtin', 'ab awk bash beep cat cc cd chown chmod chroot clear cp ' + + 'curl cut diff echo find gawk gcc get git grep kill killall ln ls make ' + + 'mkdir openssl mv nc node npm ping ps restart rm rmdir sed service sh ' + + 'shopt shred source sort sleep ssh start stop su sudo tee telnet top ' + + 'touch vi vim wall wc wget who write yes zsh'); + + function tokenBase(stream, state) { + + var sol = stream.sol(); + var ch = stream.next(); + + if (ch === '\'' || ch === '"' || ch === '`') { + state.tokens.unshift(tokenString(ch)); + return tokenize(stream, state); + } + if (ch === '#') { + if (sol && stream.eat('!')) { + stream.skipToEnd(); + return 'meta'; // 'comment'? + } + stream.skipToEnd(); + return 'comment'; + } + if (ch === '$') { + state.tokens.unshift(tokenDollar); + return tokenize(stream, state); + } + if (ch === '+' || ch === '=') { + return 'operator'; + } + if (ch === '-') { + stream.eat('-'); + stream.eatWhile(/\w/); + return 'attribute'; + } + if (/\d/.test(ch)) { + stream.eatWhile(/\d/); + if(!/\w/.test(stream.peek())) { + return 'number'; + } + } + stream.eatWhile(/[\w-]/); + var cur = stream.current(); + if (stream.peek() === '=' && /\w+/.test(cur)) return 'def'; + return words.hasOwnProperty(cur) ? words[cur] : null; + } + + function tokenString(quote) { + return function(stream, state) { + var next, end = false, escaped = false; + while ((next = stream.next()) != null) { + if (next === quote && !escaped) { + end = true; + break; + } + if (next === '$' && !escaped && quote !== '\'') { + escaped = true; + stream.backUp(1); + state.tokens.unshift(tokenDollar); + break; + } + escaped = !escaped && next === '\\'; + } + if (end || !escaped) { + state.tokens.shift(); + } + return (quote === '`' || quote === ')' ? 'quote' : 'string'); + }; + }; + + var tokenDollar = function(stream, state) { + if (state.tokens.length > 1) stream.eat('$'); + var ch = stream.next(), hungry = /\w/; + if (ch === '{') hungry = /[^}]/; + if (ch === '(') { + state.tokens[0] = tokenString(')'); + return tokenize(stream, state); + } + if (!/\d/.test(ch)) { + stream.eatWhile(hungry); + stream.eat('}'); + } + state.tokens.shift(); + return 'def'; + }; + + function tokenize(stream, state) { + return (state.tokens[0] || tokenBase) (stream, state); + }; + + return { + startState: function() {return {tokens:[]};}, + token: function(stream, state) { + if (stream.eatSpace()) return null; + return tokenize(stream, state); + } + }; +}); + +CodeMirror.defineMIME('text/x-sh', 'shell'); diff --git a/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/sieve/LICENSE b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/sieve/LICENSE new file mode 100644 index 000000000..8a74612cb --- /dev/null +++ b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/sieve/LICENSE @@ -0,0 +1,19 @@ +Copyright (C) 2012 Thomas Schmid + +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/sieve/index.html b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/sieve/index.html new file mode 100644 index 000000000..8b549815c --- /dev/null +++ b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/sieve/index.html @@ -0,0 +1,81 @@ + + + + + CodeMirror: Sieve (RFC5228) mode + + + + + + + +

CodeMirror: Sieve (RFC5228) mode

+
+ + +

MIME types defined: application/sieve.

+ + + diff --git a/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/sieve/sieve.js b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/sieve/sieve.js new file mode 100644 index 000000000..a3d081d5c --- /dev/null +++ b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/sieve/sieve.js @@ -0,0 +1,178 @@ +CodeMirror.defineMode("sieve", function(config) { + 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("if elsif else stop require"); + var atoms = words("true false not"); + var indentUnit = config.indentUnit; + + function tokenBase(stream, state) { + + var ch = stream.next(); + if (ch == "/" && stream.eat("*")) { + state.tokenize = tokenCComment; + return tokenCComment(stream, state); + } + + if (ch === '#') { + stream.skipToEnd(); + return "comment"; + } + + if (ch == "\"") { + state.tokenize = tokenString(ch); + return state.tokenize(stream, state); + } + + if (ch == "(") { + state._indent.push("("); + // add virtual angel wings so that editor behaves... + // ...more sane incase of broken brackets + state._indent.push("{"); + return null; + } + + if (ch === "{") { + state._indent.push("{"); + return null; + } + + if (ch == ")") { + state._indent.pop(); + state._indent.pop(); + } + + if (ch === "}") { + state._indent.pop(); + return null; + } + + if (ch == ",") + return null; + + if (ch == ";") + return null; + + + if (/[{}\(\),;]/.test(ch)) + return null; + + // 1*DIGIT "K" / "M" / "G" + if (/\d/.test(ch)) { + stream.eatWhile(/[\d]/); + stream.eat(/[KkMmGg]/); + return "number"; + } + + // ":" (ALPHA / "_") *(ALPHA / DIGIT / "_") + if (ch == ":") { + stream.eatWhile(/[a-zA-Z_]/); + stream.eatWhile(/[a-zA-Z0-9_]/); + + return "operator"; + } + + stream.eatWhile(/\w/); + var cur = stream.current(); + + // "text:" *(SP / HTAB) (hash-comment / CRLF) + // *(multiline-literal / multiline-dotstart) + // "." CRLF + if ((cur == "text") && stream.eat(":")) + { + state.tokenize = tokenMultiLineString; + return "string"; + } + + if (keywords.propertyIsEnumerable(cur)) + return "keyword"; + + if (atoms.propertyIsEnumerable(cur)) + return "atom"; + + return null; + } + + function tokenMultiLineString(stream, state) + { + state._multiLineString = true; + // the first line is special it may contain a comment + if (!stream.sol()) { + stream.eatSpace(); + + if (stream.peek() == "#") { + stream.skipToEnd(); + return "comment"; + } + + stream.skipToEnd(); + return "string"; + } + + if ((stream.next() == ".") && (stream.eol())) + { + state._multiLineString = false; + state.tokenize = tokenBase; + } + + return "string"; + } + + function tokenCComment(stream, state) { + var maybeEnd = false, ch; + while ((ch = stream.next()) != null) { + if (maybeEnd && ch == "/") { + state.tokenize = tokenBase; + break; + } + maybeEnd = (ch == "*"); + } + return "comment"; + } + + function tokenString(quote) { + return function(stream, state) { + var escaped = false, ch; + while ((ch = stream.next()) != null) { + if (ch == quote && !escaped) + break; + escaped = !escaped && ch == "\\"; + } + if (!escaped) state.tokenize = tokenBase; + return "string"; + }; + } + + return { + startState: function(base) { + return {tokenize: tokenBase, + baseIndent: base || 0, + _indent: []}; + }, + + token: function(stream, state) { + if (stream.eatSpace()) + return null; + + return (state.tokenize || tokenBase)(stream, state);; + }, + + indent: function(state, _textAfter) { + var length = state._indent.length; + if (_textAfter && (_textAfter[0] == "}")) + length--; + + if (length <0) + length = 0; + + return length * indentUnit; + }, + + electricChars: "}" + }; +}); + +CodeMirror.defineMIME("application/sieve", "sieve"); diff --git a/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/smalltalk/index.html b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/smalltalk/index.html new file mode 100644 index 000000000..b7aebdb7f --- /dev/null +++ b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/smalltalk/index.html @@ -0,0 +1,57 @@ + + + + + CodeMirror: Smalltalk mode + + + + + + + + +

CodeMirror: Smalltalk mode

+ +
+ + + +

Simple Smalltalk mode.

+ +

MIME types defined: text/x-stsrc.

+ + diff --git a/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/smalltalk/smalltalk.js b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/smalltalk/smalltalk.js new file mode 100644 index 000000000..eb3241751 --- /dev/null +++ b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/smalltalk/smalltalk.js @@ -0,0 +1,141 @@ +CodeMirror.defineMode('smalltalk', function(config) { + + var specialChars = /[+\-\/\\*~<>=@%|&?!.,:;^]/; + var keywords = /true|false|nil|self|super|thisContext/; + + var Context = function(tokenizer, parent) { + this.next = tokenizer; + this.parent = parent; + }; + + var Token = function(name, context, eos) { + this.name = name; + this.context = context; + this.eos = eos; + }; + + var State = function() { + this.context = new Context(next, null); + this.expectVariable = true; + this.indentation = 0; + this.userIndentationDelta = 0; + }; + + State.prototype.userIndent = function(indentation) { + this.userIndentationDelta = indentation > 0 ? (indentation / config.indentUnit - this.indentation) : 0; + }; + + var next = function(stream, context, state) { + var token = new Token(null, context, false); + var aChar = stream.next(); + + if (aChar === '"') { + token = nextComment(stream, new Context(nextComment, context)); + + } else if (aChar === '\'') { + token = nextString(stream, new Context(nextString, context)); + + } else if (aChar === '#') { + stream.eatWhile(/[^ .\[\]()]/); + token.name = 'string-2'; + + } else if (aChar === '$') { + if (stream.next() === '<') { + stream.eatWhile(/[^ >]/); + stream.next(); + } + token.name = 'string-2'; + + } else if (aChar === '|' && state.expectVariable) { + token.context = new Context(nextTemporaries, context); + + } else if (/[\[\]{}()]/.test(aChar)) { + token.name = 'bracket'; + token.eos = /[\[{(]/.test(aChar); + + if (aChar === '[') { + state.indentation++; + } else if (aChar === ']') { + state.indentation = Math.max(0, state.indentation - 1); + } + + } else if (specialChars.test(aChar)) { + stream.eatWhile(specialChars); + token.name = 'operator'; + token.eos = aChar !== ';'; // ; cascaded message expression + + } else if (/\d/.test(aChar)) { + stream.eatWhile(/[\w\d]/); + token.name = 'number'; + + } else if (/[\w_]/.test(aChar)) { + stream.eatWhile(/[\w\d_]/); + token.name = state.expectVariable ? (keywords.test(stream.current()) ? 'keyword' : 'variable') : null; + + } else { + token.eos = state.expectVariable; + } + + return token; + }; + + var nextComment = function(stream, context) { + stream.eatWhile(/[^"]/); + return new Token('comment', stream.eat('"') ? context.parent : context, true); + }; + + var nextString = function(stream, context) { + stream.eatWhile(/[^']/); + return new Token('string', stream.eat('\'') ? context.parent : context, false); + }; + + var nextTemporaries = function(stream, context) { + var token = new Token(null, context, false); + var aChar = stream.next(); + + if (aChar === '|') { + token.context = context.parent; + token.eos = true; + + } else { + stream.eatWhile(/[^|]/); + token.name = 'variable'; + } + + return token; + }; + + return { + startState: function() { + return new State; + }, + + token: function(stream, state) { + state.userIndent(stream.indentation()); + + if (stream.eatSpace()) { + return null; + } + + var token = state.context.next(stream, state.context, state); + state.context = token.context; + state.expectVariable = token.eos; + + return token.name; + }, + + blankLine: function(state) { + state.userIndent(0); + }, + + indent: function(state, textAfter) { + var i = state.context.next === next && textAfter && textAfter.charAt(0) === ']' ? -1 : state.userIndentationDelta; + return (state.indentation + i) * config.indentUnit; + }, + + electricChars: ']' + }; + +}); + +CodeMirror.defineMIME('text/x-stsrc', {name: 'smalltalk'}); diff --git a/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/smarty/index.html b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/smarty/index.html new file mode 100644 index 000000000..9e4173380 --- /dev/null +++ b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/smarty/index.html @@ -0,0 +1,126 @@ + + + + + CodeMirror: Smarty mode + + + + + + + +

CodeMirror: Smarty mode

+ +

Default settings (Smarty 2, { and } delimiters)

+
+ + + +
+ +

Smarty 2, custom delimiters

+
+ + + +
+ +

Smarty 3

+ + + + + + +

A plain text/Smarty version 2 or 3 mode, which allows for custom delimiter tags.

+ +

MIME types defined: text/x-smarty

+ + diff --git a/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/smarty/smarty.js b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/smarty/smarty.js new file mode 100644 index 000000000..826c2b966 --- /dev/null +++ b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/smarty/smarty.js @@ -0,0 +1,205 @@ +/** + * Smarty 2 and 3 mode. + */ +CodeMirror.defineMode("smarty", function(config) { + "use strict"; + + // our default settings; check to see if they're overridden + var settings = { + rightDelimiter: '}', + leftDelimiter: '{', + smartyVersion: 2 // for backward compatibility + }; + if (config.hasOwnProperty("leftDelimiter")) { + settings.leftDelimiter = config.leftDelimiter; + } + if (config.hasOwnProperty("rightDelimiter")) { + settings.rightDelimiter = config.rightDelimiter; + } + if (config.hasOwnProperty("smartyVersion") && config.smartyVersion === 3) { + settings.smartyVersion = 3; + } + + var keyFunctions = ["debug", "extends", "function", "include", "literal"]; + var last; + var regs = { + operatorChars: /[+\-*&%=<>!?]/, + validIdentifier: /[a-zA-Z0-9_]/, + stringChar: /['"]/ + }; + + var helpers = { + cont: function(style, lastType) { + last = lastType; + return style; + }, + chain: function(stream, state, parser) { + state.tokenize = parser; + return parser(stream, state); + } + }; + + + // our various parsers + var parsers = { + + // the main tokenizer + tokenizer: function(stream, state) { + if (stream.match(settings.leftDelimiter, true)) { + if (stream.eat("*")) { + return helpers.chain(stream, state, parsers.inBlock("comment", "*" + settings.rightDelimiter)); + } else { + // Smarty 3 allows { and } surrounded by whitespace to NOT slip into Smarty mode + state.depth++; + var isEol = stream.eol(); + var isFollowedByWhitespace = /\s/.test(stream.peek()); + if (settings.smartyVersion === 3 && settings.leftDelimiter === "{" && (isEol || isFollowedByWhitespace)) { + state.depth--; + return null; + } else { + state.tokenize = parsers.smarty; + last = "startTag"; + return "tag"; + } + } + } else { + stream.next(); + return null; + } + }, + + // parsing Smarty content + smarty: function(stream, state) { + if (stream.match(settings.rightDelimiter, true)) { + if (settings.smartyVersion === 3) { + state.depth--; + if (state.depth <= 0) { + state.tokenize = parsers.tokenizer; + } + } else { + state.tokenize = parsers.tokenizer; + } + return helpers.cont("tag", null); + } + + if (stream.match(settings.leftDelimiter, true)) { + state.depth++; + return helpers.cont("tag", "startTag"); + } + + var ch = stream.next(); + if (ch == "$") { + stream.eatWhile(regs.validIdentifier); + return helpers.cont("variable-2", "variable"); + } else if (ch == "|") { + return helpers.cont("operator", "pipe"); + } else if (ch == ".") { + return helpers.cont("operator", "property"); + } else if (regs.stringChar.test(ch)) { + state.tokenize = parsers.inAttribute(ch); + return helpers.cont("string", "string"); + } else if (regs.operatorChars.test(ch)) { + stream.eatWhile(regs.operatorChars); + return helpers.cont("operator", "operator"); + } else if (ch == "[" || ch == "]") { + return helpers.cont("bracket", "bracket"); + } else if (ch == "(" || ch == ")") { + return helpers.cont("bracket", "operator"); + } else if (/\d/.test(ch)) { + stream.eatWhile(/\d/); + return helpers.cont("number", "number"); + } else { + + if (state.last == "variable") { + if (ch == "@") { + stream.eatWhile(regs.validIdentifier); + return helpers.cont("property", "property"); + } else if (ch == "|") { + stream.eatWhile(regs.validIdentifier); + return helpers.cont("qualifier", "modifier"); + } + } else if (state.last == "pipe") { + stream.eatWhile(regs.validIdentifier); + return helpers.cont("qualifier", "modifier"); + } else if (state.last == "whitespace") { + stream.eatWhile(regs.validIdentifier); + return helpers.cont("attribute", "modifier"); + } if (state.last == "property") { + stream.eatWhile(regs.validIdentifier); + return helpers.cont("property", null); + } else if (/\s/.test(ch)) { + last = "whitespace"; + return null; + } + + var str = ""; + if (ch != "/") { + str += ch; + } + var c = null; + while (c = stream.eat(regs.validIdentifier)) { + str += c; + } + for (var i=0, j=keyFunctions.length; i + + + + CodeMirror: SPARQL mode + + + + + + + + +

CodeMirror: SPARQL mode

+
+ + +

MIME types defined: application/x-sparql-query.

+ + + diff --git a/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/sparql/sparql.js b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/sparql/sparql.js new file mode 100644 index 000000000..f7237698d --- /dev/null +++ b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/sparql/sparql.js @@ -0,0 +1,143 @@ +CodeMirror.defineMode("sparql", function(config) { + var indentUnit = config.indentUnit; + var curPunc; + + function wordRegexp(words) { + return new RegExp("^(?:" + words.join("|") + ")$", "i"); + } + var ops = wordRegexp(["str", "lang", "langmatches", "datatype", "bound", "sameterm", "isiri", "isuri", + "isblank", "isliteral", "union", "a"]); + var keywords = wordRegexp(["base", "prefix", "select", "distinct", "reduced", "construct", "describe", + "ask", "from", "named", "where", "order", "limit", "offset", "filter", "optional", + "graph", "by", "asc", "desc"]); + var operatorChars = /[*+\-<>=&|]/; + + function tokenBase(stream, state) { + var ch = stream.next(); + curPunc = null; + if (ch == "$" || ch == "?") { + stream.match(/^[\w\d]*/); + return "variable-2"; + } + else if (ch == "<" && !stream.match(/^[\s\u00a0=]/, false)) { + stream.match(/^[^\s\u00a0>]*>?/); + return "atom"; + } + else if (ch == "\"" || ch == "'") { + state.tokenize = tokenLiteral(ch); + return state.tokenize(stream, state); + } + else if (/[{}\(\),\.;\[\]]/.test(ch)) { + curPunc = ch; + return null; + } + else if (ch == "#") { + stream.skipToEnd(); + return "comment"; + } + else if (operatorChars.test(ch)) { + stream.eatWhile(operatorChars); + return null; + } + else if (ch == ":") { + stream.eatWhile(/[\w\d\._\-]/); + return "atom"; + } + else { + stream.eatWhile(/[_\w\d]/); + if (stream.eat(":")) { + stream.eatWhile(/[\w\d_\-]/); + return "atom"; + } + var word = stream.current(); + if (ops.test(word)) + return null; + else if (keywords.test(word)) + return "keyword"; + else + return "variable"; + } + } + + function tokenLiteral(quote) { + return function(stream, state) { + var escaped = false, ch; + while ((ch = stream.next()) != null) { + if (ch == quote && !escaped) { + state.tokenize = tokenBase; + break; + } + escaped = !escaped && ch == "\\"; + } + 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("application/x-sparql-query", "sparql"); diff --git a/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/sql/index.html b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/sql/index.html new file mode 100644 index 000000000..acf60b88c --- /dev/null +++ b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/sql/index.html @@ -0,0 +1,68 @@ + + + + + SQL Mode for CodeMirror + + + + + + + + +

SQL Mode for CodeMirror

+
+ +
+

MIME types defined: + text/x-sql, + text/x-mysql, + text/x-mariadb, + text/x-cassandra, + text/x-plsql. +

+

+ Tests: + normal, + verbose. +

+ + diff --git a/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/sql/sql.js b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/sql/sql.js new file mode 100644 index 000000000..9016cc7aa --- /dev/null +++ b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/sql/sql.js @@ -0,0 +1,349 @@ +CodeMirror.defineMode("sql", function(config, parserConfig) { + "use strict"; + + var client = parserConfig.client || {}, + atoms = parserConfig.atoms || {"false": true, "true": true, "null": true}, + builtin = parserConfig.builtin || {}, + keywords = parserConfig.keywords || {}, + operatorChars = parserConfig.operatorChars || /^[*+\-%<>!=&|~^]/, + support = parserConfig.support || {}, + hooks = parserConfig.hooks || {}, + dateSQL = parserConfig.dateSQL || {"date" : true, "time" : true, "timestamp" : true}; + + function tokenBase(stream, state) { + var ch = stream.next(); + + // call hooks from the mime type + if (hooks[ch]) { + var result = hooks[ch](stream, state); + if (result !== false) return result; + } + + if (support.hexNumber == true && + ((ch == "0" && stream.match(/^[xX][0-9a-fA-F]+/)) + || (ch == "x" || ch == "X") && stream.match(/^'[0-9a-fA-F]+'/))) { + // hex + // ref: http://dev.mysql.com/doc/refman/5.5/en/hexadecimal-literals.html + return "number"; + } else if (support.binaryNumber == true && + (((ch == "b" || ch == "B") && stream.match(/^'[01]+'/)) + || (ch == "0" && stream.match(/^b[01]+/)))) { + // bitstring + // ref: http://dev.mysql.com/doc/refman/5.5/en/bit-field-literals.html + return "number"; + } else if (ch.charCodeAt(0) > 47 && ch.charCodeAt(0) < 58) { + // numbers + // ref: http://dev.mysql.com/doc/refman/5.5/en/number-literals.html + stream.match(/^[0-9]*\.?[0-9]+([eE][-+]?[0-9]+)?/); + support.decimallessFloat == true && stream.eat('.'); + return "number"; + } else if (ch == "?" && (stream.eatSpace() || stream.eol() || stream.eat(";"))) { + // placeholders + return "variable-3"; + } else if (ch == "'" || (ch == '"' && support.doubleQuote)) { + // strings + // ref: http://dev.mysql.com/doc/refman/5.5/en/string-literals.html + state.tokenize = tokenLiteral(ch); + return state.tokenize(stream, state); + } else if ((((support.nCharCast == true && (ch == "n" || ch == "N")) + || (support.charsetCast == true && ch == "_" && stream.match(/[a-z][a-z0-9]*/i))) + && (stream.peek() == "'" || stream.peek() == '"'))) { + // charset casting: _utf8'str', N'str', n'str' + // ref: http://dev.mysql.com/doc/refman/5.5/en/string-literals.html + return "keyword"; + } else if (/^[\(\),\;\[\]]/.test(ch)) { + // no highlightning + return null; + } else if (support.commentSlashSlash && ch == "/" && stream.eat("/")) { + // 1-line comment + stream.skipToEnd(); + return "comment"; + } else if ((support.commentHash && ch == "#") + || (ch == "-" && stream.eat("-") && (!support.commentSpaceRequired || stream.eat(" ")))) { + // 1-line comments + // ref: https://kb.askmonty.org/en/comment-syntax/ + stream.skipToEnd(); + return "comment"; + } else if (ch == "/" && stream.eat("*")) { + // multi-line comments + // ref: https://kb.askmonty.org/en/comment-syntax/ + state.tokenize = tokenComment; + return state.tokenize(stream, state); + } else if (ch == ".") { + // .1 for 0.1 + if (support.zerolessFloat == true && stream.match(/^(?:\d+(?:e[+-]?\d+)?)/i)) { + return "number"; + } + // .table_name (ODBC) + // // ref: http://dev.mysql.com/doc/refman/5.6/en/identifier-qualifiers.html + if (support.ODBCdotTable == true && stream.match(/^[a-zA-Z_]+/)) { + return "variable-2"; + } + } else if (operatorChars.test(ch)) { + // operators + stream.eatWhile(operatorChars); + return null; + } else if (ch == '{' && + (stream.match(/^( )*(d|D|t|T|ts|TS)( )*'[^']*'( )*}/) || stream.match(/^( )*(d|D|t|T|ts|TS)( )*"[^"]*"( )*}/))) { + // dates (weird ODBC syntax) + // ref: http://dev.mysql.com/doc/refman/5.5/en/date-and-time-literals.html + return "number"; + } else { + stream.eatWhile(/^[_\w\d]/); + var word = stream.current().toLowerCase(); + // dates (standard SQL syntax) + // ref: http://dev.mysql.com/doc/refman/5.5/en/date-and-time-literals.html + if (dateSQL.hasOwnProperty(word) && (stream.match(/^( )+'[^']*'/) || stream.match(/^( )+"[^"]*"/))) + return "number"; + if (atoms.hasOwnProperty(word)) return "atom"; + if (builtin.hasOwnProperty(word)) return "builtin"; + if (keywords.hasOwnProperty(word)) return "keyword"; + if (client.hasOwnProperty(word)) return "string-2"; + return null; + } + } + + // 'string', with char specified in quote escaped by '\' + function tokenLiteral(quote) { + return function(stream, state) { + var escaped = false, ch; + while ((ch = stream.next()) != null) { + if (ch == quote && !escaped) { + state.tokenize = tokenBase; + break; + } + escaped = !escaped && ch == "\\"; + } + return "string"; + }; + } + function tokenComment(stream, state) { + while (true) { + if (stream.skipTo("*")) { + stream.next(); + if (stream.eat("/")) { + state.tokenize = tokenBase; + break; + } + } else { + stream.skipToEnd(); + break; + } + } + return "comment"; + } + + function pushContext(stream, state, type) { + state.context = { + prev: state.context, + indent: stream.indentation(), + col: stream.column(), + type: type + }; + } + + function popContext(state) { + state.indent = state.context.indent; + state.context = state.context.prev; + } + + return { + startState: function() { + return {tokenize: tokenBase, context: null}; + }, + + token: function(stream, state) { + if (stream.sol()) { + if (state.context && state.context.align == null) + state.context.align = false; + } + if (stream.eatSpace()) return null; + + var style = state.tokenize(stream, state); + if (style == "comment") return style; + + if (state.context && state.context.align == null) + state.context.align = true; + + var tok = stream.current(); + if (tok == "(") + pushContext(stream, state, ")"); + else if (tok == "[") + pushContext(stream, state, "]"); + else if (state.context && state.context.type == tok) + popContext(state); + return style; + }, + + indent: function(state, textAfter) { + var cx = state.context; + if (!cx) return CodeMirror.Pass; + if (cx.align) return cx.col + (textAfter.charAt(0) == cx.type ? 0 : 1); + else return cx.indent + config.indentUnit; + } + }; +}); + +(function() { + "use strict"; + + // `identifier` + function hookIdentifier(stream) { + // MySQL/MariaDB identifiers + // ref: http://dev.mysql.com/doc/refman/5.6/en/identifier-qualifiers.html + var ch; + while ((ch = stream.next()) != null) { + if (ch == "`" && !stream.eat("`")) return "variable-2"; + } + return null; + } + + // variable token + function hookVar(stream) { + // variables + // @@prefix.varName @varName + // varName can be quoted with ` or ' or " + // ref: http://dev.mysql.com/doc/refman/5.5/en/user-variables.html + if (stream.eat("@")) { + stream.match(/^session\./); + stream.match(/^local\./); + stream.match(/^global\./); + } + + if (stream.eat("'")) { + stream.match(/^.*'/); + return "variable-2"; + } else if (stream.eat('"')) { + stream.match(/^.*"/); + return "variable-2"; + } else if (stream.eat("`")) { + stream.match(/^.*`/); + return "variable-2"; + } else if (stream.match(/^[0-9a-zA-Z$\.\_]+/)) { + return "variable-2"; + } + return null; + }; + + // short client keyword token + function hookClient(stream) { + // \N means NULL + // ref: http://dev.mysql.com/doc/refman/5.5/en/null-values.html + if (stream.eat("N")) { + return "atom"; + } + // \g, etc + // ref: http://dev.mysql.com/doc/refman/5.5/en/mysql-commands.html + return stream.match(/^[a-zA-Z.#!?]/) ? "variable-2" : null; + } + + // these keywords are used by all SQL dialects (however, a mode can still overwrite it) + var sqlKeywords = "alter and as asc between by count create delete desc distinct drop from having in insert into is join like not on or order select set table union update values where "; + + // turn a space-separated list into an array + function set(str) { + var obj = {}, words = str.split(" "); + for (var i = 0; i < words.length; ++i) obj[words[i]] = true; + return obj; + } + + // A generic SQL Mode. It's not a standard, it just try to support what is generally supported + CodeMirror.defineMIME("text/x-sql", { + name: "sql", + keywords: set(sqlKeywords + "begin"), + builtin: set("bool boolean bit blob enum long longblob longtext medium mediumblob mediumint mediumtext time timestamp tinyblob tinyint tinytext text bigint int int1 int2 int3 int4 int8 integer float float4 float8 double char varbinary varchar varcharacter precision real date datetime year unsigned signed decimal numeric"), + atoms: set("false true null unknown"), + operatorChars: /^[*+\-%<>!=]/, + dateSQL: set("date time timestamp"), + support: set("ODBCdotTable doubleQuote binaryNumber hexNumber") + }); + + CodeMirror.defineMIME("text/x-mysql", { + name: "sql", + client: set("charset clear connect edit ego exit go help nopager notee nowarning pager print prompt quit rehash source status system tee"), + keywords: set(sqlKeywords + "accessible action add after algorithm all analyze asensitive at authors auto_increment autocommit avg avg_row_length before binary binlog both btree cache call cascade cascaded case catalog_name chain change changed character check checkpoint checksum class_origin client_statistics close coalesce code collate collation collations column columns comment commit committed completion concurrent condition connection consistent constraint contains continue contributors convert cross current_date current_time current_timestamp current_user cursor data database databases day_hour day_microsecond day_minute day_second deallocate dec declare default delay_key_write delayed delimiter des_key_file describe deterministic dev_pop dev_samp deviance directory disable discard distinctrow div dual dumpfile each elseif enable enclosed end ends engine engines enum errors escape escaped even event events every execute exists exit explain extended fast fetch field fields first flush for force foreign found_rows full fulltext function general global grant grants group groupby_concat handler hash help high_priority hosts hour_microsecond hour_minute hour_second if ignore ignore_server_ids import index index_statistics infile inner innodb inout insensitive insert_method install interval invoker isolation iterate key keys kill language last leading leave left level limit linear lines list load local localtime localtimestamp lock logs low_priority master master_heartbeat_period master_ssl_verify_server_cert masters match max max_rows maxvalue message_text middleint migrate min min_rows minute_microsecond minute_second mod mode modifies modify mutex mysql_errno natural next no no_write_to_binlog offline offset one online open optimize option optionally out outer outfile pack_keys parser partition partitions password phase plugin plugins prepare preserve prev primary privileges procedure processlist profile profiles purge query quick range read read_write reads real rebuild recover references regexp relaylog release remove rename reorganize repair repeatable replace require resignal restrict resume return returns revoke right rlike rollback rollup row row_format rtree savepoint schedule schema schema_name schemas second_microsecond security sensitive separator serializable server session share show signal slave slow smallint snapshot soname spatial specific sql sql_big_result sql_buffer_result sql_cache sql_calc_found_rows sql_no_cache sql_small_result sqlexception sqlstate sqlwarning ssl start starting starts status std stddev stddev_pop stddev_samp storage straight_join subclass_origin sum suspend table_name table_statistics tables tablespace temporary terminated to trailing transaction trigger triggers truncate uncommitted undo uninstall unique unlock upgrade usage use use_frm user user_resources user_statistics using utc_date utc_time utc_timestamp value variables varying view views warnings when while with work write xa xor year_month zerofill begin do then else loop repeat"), + builtin: set("bool boolean bit blob decimal double enum float long longblob longtext medium mediumblob mediumint mediumtext time timestamp tinyblob tinyint tinytext text bigint int int1 int2 int3 int4 int8 integer float float4 float8 double char varbinary varchar varcharacter precision date datetime year unsigned signed numeric"), + atoms: set("false true null unknown"), + operatorChars: /^[*+\-%<>!=&|^]/, + dateSQL: set("date time timestamp"), + support: set("ODBCdotTable decimallessFloat zerolessFloat binaryNumber hexNumber doubleQuote nCharCast charsetCast commentHash commentSpaceRequired"), + hooks: { + "@": hookVar, + "`": hookIdentifier, + "\\": hookClient + } + }); + + CodeMirror.defineMIME("text/x-mariadb", { + name: "sql", + client: set("charset clear connect edit ego exit go help nopager notee nowarning pager print prompt quit rehash source status system tee"), + keywords: set(sqlKeywords + "accessible action add after algorithm all always analyze asensitive at authors auto_increment autocommit avg avg_row_length before binary binlog both btree cache call cascade cascaded case catalog_name chain change changed character check checkpoint checksum class_origin client_statistics close coalesce code collate collation collations column columns comment commit committed completion concurrent condition connection consistent constraint contains continue contributors convert cross current_date current_time current_timestamp current_user cursor data database databases day_hour day_microsecond day_minute day_second deallocate dec declare default delay_key_write delayed delimiter des_key_file describe deterministic dev_pop dev_samp deviance directory disable discard distinctrow div dual dumpfile each elseif enable enclosed end ends engine engines enum errors escape escaped even event events every execute exists exit explain extended fast fetch field fields first flush for force foreign found_rows full fulltext function general generated global grant grants group groupby_concat handler hard hash help high_priority hosts hour_microsecond hour_minute hour_second if ignore ignore_server_ids import index index_statistics infile inner innodb inout insensitive insert_method install interval invoker isolation iterate key keys kill language last leading leave left level limit linear lines list load local localtime localtimestamp lock logs low_priority master master_heartbeat_period master_ssl_verify_server_cert masters match max max_rows maxvalue message_text middleint migrate min min_rows minute_microsecond minute_second mod mode modifies modify mutex mysql_errno natural next no no_write_to_binlog offline offset one online open optimize option optionally out outer outfile pack_keys parser partition partitions password persistent phase plugin plugins prepare preserve prev primary privileges procedure processlist profile profiles purge query quick range read read_write reads real rebuild recover references regexp relaylog release remove rename reorganize repair repeatable replace require resignal restrict resume return returns revoke right rlike rollback rollup row row_format rtree savepoint schedule schema schema_name schemas second_microsecond security sensitive separator serializable server session share show signal slave slow smallint snapshot soft soname spatial specific sql sql_big_result sql_buffer_result sql_cache sql_calc_found_rows sql_no_cache sql_small_result sqlexception sqlstate sqlwarning ssl start starting starts status std stddev stddev_pop stddev_samp storage straight_join subclass_origin sum suspend table_name table_statistics tables tablespace temporary terminated to trailing transaction trigger triggers truncate uncommitted undo uninstall unique unlock upgrade usage use use_frm user user_resources user_statistics using utc_date utc_time utc_timestamp value variables varying view views virtual warnings when while with work write xa xor year_month zerofill begin do then else loop repeat"), + builtin: set("bool boolean bit blob decimal double enum float long longblob longtext medium mediumblob mediumint mediumtext time timestamp tinyblob tinyint tinytext text bigint int int1 int2 int3 int4 int8 integer float float4 float8 double char varbinary varchar varcharacter precision date datetime year unsigned signed numeric"), + atoms: set("false true null unknown"), + operatorChars: /^[*+\-%<>!=&|^]/, + dateSQL: set("date time timestamp"), + support: set("ODBCdotTable decimallessFloat zerolessFloat binaryNumber hexNumber doubleQuote nCharCast charsetCast commentHash commentSpaceRequired"), + hooks: { + "@": hookVar, + "`": hookIdentifier, + "\\": hookClient + } + }); + + // the query language used by Apache Cassandra is called CQL, but this mime type + // is called Cassandra to avoid confusion with Contextual Query Language + CodeMirror.defineMIME("text/x-cassandra", { + name: "sql", + client: { }, + keywords: set("use select from using consistency where limit first reversed first and in insert into values using consistency ttl update set delete truncate begin batch apply create keyspace with columnfamily primary key index on drop alter type add any one quorum all local_quorum each_quorum"), + builtin: set("ascii bigint blob boolean counter decimal double float int text timestamp uuid varchar varint"), + atoms: set("false true"), + operatorChars: /^[<>=]/, + dateSQL: { }, + support: set("commentSlashSlash decimallessFloat"), + hooks: { } + }); + + // this is based on Peter Raganitsch's 'plsql' mode + CodeMirror.defineMIME("text/x-plsql", { + name: "sql", + client: set("appinfo arraysize autocommit autoprint autorecovery autotrace blockterminator break btitle cmdsep colsep compatibility compute concat copycommit copytypecheck define describe echo editfile embedded escape exec execute feedback flagger flush heading headsep instance linesize lno loboffset logsource long longchunksize markup native newpage numformat numwidth pagesize pause pno recsep recsepchar release repfooter repheader serveroutput shiftinout show showmode size spool sqlblanklines sqlcase sqlcode sqlcontinue sqlnumber sqlpluscompatibility sqlprefix sqlprompt sqlterminator suffix tab term termout time timing trimout trimspool ttitle underline verify version wrap"), + keywords: set("abort accept access add all alter and any array arraylen as asc assert assign at attributes audit authorization avg base_table begin between binary_integer body boolean by case cast char char_base check close cluster clusters colauth column comment commit compress connect connected constant constraint crash create current currval cursor data_base database date dba deallocate debugoff debugon decimal declare default definition delay delete desc digits dispose distinct do drop else elsif enable end entry escape exception exception_init exchange exclusive exists exit external fast fetch file for force form from function generic goto grant group having identified if immediate in increment index indexes indicator initial initrans insert interface intersect into is key level library like limited local lock log logging long loop master maxextents maxtrans member minextents minus mislabel mode modify multiset new next no noaudit nocompress nologging noparallel not nowait number_base object of off offline on online only open option or order out package parallel partition pctfree pctincrease pctused pls_integer positive positiven pragma primary prior private privileges procedure public raise range raw read rebuild record ref references refresh release rename replace resource restrict return returning reverse revoke rollback row rowid rowlabel rownum rows run savepoint schema segment select separate session set share snapshot some space split sql start statement storage subtype successful synonym tabauth table tables tablespace task terminate then to trigger truncate type union unique unlimited unrecoverable unusable update use using validate value values variable view views when whenever where while with work"), + functions: set("abs acos add_months ascii asin atan atan2 average bfilename ceil chartorowid chr concat convert cos cosh count decode deref dual dump dup_val_on_index empty error exp false floor found glb greatest hextoraw initcap instr instrb isopen last_day least lenght lenghtb ln lower lpad ltrim lub make_ref max min mod months_between new_time next_day nextval nls_charset_decl_len nls_charset_id nls_charset_name nls_initcap nls_lower nls_sort nls_upper nlssort no_data_found notfound null nvl others power rawtohex reftohex round rowcount rowidtochar rpad rtrim sign sin sinh soundex sqlcode sqlerrm sqrt stddev substr substrb sum sysdate tan tanh to_char to_date to_label to_multi_byte to_number to_single_byte translate true trunc uid upper user userenv variance vsize"), + builtin: set("bfile blob character clob dec float int integer mlslabel natural naturaln nchar nclob number numeric nvarchar2 real rowtype signtype smallint string varchar varchar2"), + operatorChars: /^[*+\-%<>!=~]/, + dateSQL: set("date time timestamp"), + support: set("doubleQuote nCharCast zerolessFloat binaryNumber hexNumber") + }); +}()); + +/* + How Properties of Mime Types are used by SQL Mode + ================================================= + + keywords: + A list of keywords you want to be highlighted. + functions: + A list of function names you want to be highlighted. + builtin: + A list of builtin types you want to be highlighted (if you want types to be of class "builtin" instead of "keyword"). + operatorChars: + All characters that must be handled as operators. + client: + Commands parsed and executed by the client (not the server). + support: + A list of supported syntaxes which are not common, but are supported by more than 1 DBMS. + * ODBCdotTable: .tableName + * zerolessFloat: .1 + * doubleQuote + * nCharCast: N'string' + * charsetCast: _utf8'string' + * commentHash: use # char for comments + * commentSlashSlash: use // for comments + * commentSpaceRequired: require a space after -- for comments + atoms: + Keywords that must be highlighted as atoms,. Some DBMS's support more atoms than others: + UNKNOWN, INFINITY, UNDERFLOW, NaN... + dateSQL: + Used for date/time SQL standard syntax, because not all DBMS's support same temporal types. +*/ diff --git a/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/stex/index.html b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/stex/index.html new file mode 100644 index 000000000..2dafe6981 --- /dev/null +++ b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/stex/index.html @@ -0,0 +1,98 @@ + + + + + CodeMirror: sTeX mode + + + + + + + +

CodeMirror: sTeX mode

+
+ + +

MIME types defined: text/x-stex.

+ +

Parsing/Highlighting Tests: normal, verbose.

+ + + diff --git a/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/stex/stex.js b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/stex/stex.js new file mode 100644 index 000000000..ca04c24f2 --- /dev/null +++ b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/stex/stex.js @@ -0,0 +1,246 @@ +/* + * Author: Constantin Jucovschi (c.jucovschi@jacobs-university.de) + * Licence: MIT + */ + +CodeMirror.defineMode("stex", function() { + "use strict"; + + function pushCommand(state, command) { + state.cmdState.push(command); + } + + function peekCommand(state) { + if (state.cmdState.length > 0) { + return state.cmdState[state.cmdState.length - 1]; + } else { + return null; + } + } + + function popCommand(state) { + var plug = state.cmdState.pop(); + if (plug) { + plug.closeBracket(); + } + } + + // returns the non-default plugin closest to the end of the list + function getMostPowerful(state) { + var context = state.cmdState; + for (var i = context.length - 1; i >= 0; i--) { + var plug = context[i]; + if (plug.name == "DEFAULT") { + continue; + } + return plug; + } + return { styleIdentifier: function() { return null; } }; + } + + function addPluginPattern(pluginName, cmdStyle, styles) { + return function () { + this.name = pluginName; + this.bracketNo = 0; + this.style = cmdStyle; + this.styles = styles; + this.argument = null; // \begin and \end have arguments that follow. These are stored in the plugin + + this.styleIdentifier = function() { + return this.styles[this.bracketNo - 1] || null; + }; + this.openBracket = function() { + this.bracketNo++; + return "bracket"; + }; + this.closeBracket = function() {}; + }; + } + + var plugins = {}; + + plugins["importmodule"] = addPluginPattern("importmodule", "tag", ["string", "builtin"]); + plugins["documentclass"] = addPluginPattern("documentclass", "tag", ["", "atom"]); + plugins["usepackage"] = addPluginPattern("usepackage", "tag", ["atom"]); + plugins["begin"] = addPluginPattern("begin", "tag", ["atom"]); + plugins["end"] = addPluginPattern("end", "tag", ["atom"]); + + plugins["DEFAULT"] = function () { + this.name = "DEFAULT"; + this.style = "tag"; + + this.styleIdentifier = this.openBracket = this.closeBracket = function() {}; + }; + + function setState(state, f) { + state.f = f; + } + + // called when in a normal (no environment) context + function normal(source, state) { + var plug; + // Do we look like '\command' ? If so, attempt to apply the plugin 'command' + if (source.match(/^\\[a-zA-Z@]+/)) { + var cmdName = source.current().slice(1); + plug = plugins[cmdName] || plugins["DEFAULT"]; + plug = new plug(); + pushCommand(state, plug); + setState(state, beginParams); + return plug.style; + } + + // escape characters + if (source.match(/^\\[$&%#{}_]/)) { + return "tag"; + } + + // white space control characters + if (source.match(/^\\[,;!\/\\]/)) { + return "tag"; + } + + // find if we're starting various math modes + if (source.match("\\[")) { + setState(state, function(source, state){ return inMathMode(source, state, "\\]"); }); + return "keyword"; + } + if (source.match("$$")) { + setState(state, function(source, state){ return inMathMode(source, state, "$$"); }); + return "keyword"; + } + if (source.match("$")) { + setState(state, function(source, state){ return inMathMode(source, state, "$"); }); + return "keyword"; + } + + var ch = source.next(); + if (ch == "%") { + // special case: % at end of its own line; stay in same state + if (!source.eol()) { + setState(state, inCComment); + } + return "comment"; + } + else if (ch == '}' || ch == ']') { + plug = peekCommand(state); + if (plug) { + plug.closeBracket(ch); + setState(state, beginParams); + } else { + return "error"; + } + return "bracket"; + } else if (ch == '{' || ch == '[') { + plug = plugins["DEFAULT"]; + plug = new plug(); + pushCommand(state, plug); + return "bracket"; + } + else if (/\d/.test(ch)) { + source.eatWhile(/[\w.%]/); + return "atom"; + } + else { + source.eatWhile(/[\w\-_]/); + plug = getMostPowerful(state); + if (plug.name == 'begin') { + plug.argument = source.current(); + } + return plug.styleIdentifier(); + } + } + + function inCComment(source, state) { + source.skipToEnd(); + setState(state, normal); + return "comment"; + } + + function inMathMode(source, state, endModeSeq) { + if (source.eatSpace()) { + return null; + } + if (source.match(endModeSeq)) { + setState(state, normal); + return "keyword"; + } + if (source.match(/^\\[a-zA-Z@]+/)) { + return "tag"; + } + if (source.match(/^[a-zA-Z]+/)) { + return "variable-2"; + } + // escape characters + if (source.match(/^\\[$&%#{}_]/)) { + return "tag"; + } + // white space control characters + if (source.match(/^\\[,;!\/]/)) { + return "tag"; + } + // special math-mode characters + if (source.match(/^[\^_&]/)) { + return "tag"; + } + // non-special characters + if (source.match(/^[+\-<>|=,\/@!*:;'"`~#?]/)) { + return null; + } + if (source.match(/^(\d+\.\d*|\d*\.\d+|\d+)/)) { + return "number"; + } + var ch = source.next(); + if (ch == "{" || ch == "}" || ch == "[" || ch == "]" || ch == "(" || ch == ")") { + return "bracket"; + } + + // eat comments here, because inCComment returns us to normal state! + if (ch == "%") { + if (!source.eol()) { + source.skipToEnd(); + } + return "comment"; + } + return "error"; + } + + function beginParams(source, state) { + var ch = source.peek(), lastPlug; + if (ch == '{' || ch == '[') { + lastPlug = peekCommand(state); + lastPlug.openBracket(ch); + source.eat(ch); + setState(state, normal); + return "bracket"; + } + if (/[ \t\r]/.test(ch)) { + source.eat(ch); + return null; + } + setState(state, normal); + popCommand(state); + + return normal(source, state); + } + + return { + startState: function() { + return { + cmdState: [], + f: normal + }; + }, + copyState: function(s) { + return { + cmdState: s.cmdState.slice(), + f: s.f + }; + }, + token: function(stream, state) { + return state.f(stream, state); + } + }; +}); + +CodeMirror.defineMIME("text/x-stex", "stex"); +CodeMirror.defineMIME("text/x-latex", "stex"); diff --git a/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/stex/test.js b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/stex/test.js new file mode 100644 index 000000000..ab629e81e --- /dev/null +++ b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/stex/test.js @@ -0,0 +1,120 @@ +(function() { + var mode = CodeMirror.getMode({tabSize: 4}, "stex"); + function MT(name) { test.mode(name, mode, Array.prototype.slice.call(arguments, 1)); } + + MT("word", + "foo"); + + MT("twoWords", + "foo bar"); + + MT("beginEndDocument", + "[tag \\begin][bracket {][atom document][bracket }]", + "[tag \\end][bracket {][atom document][bracket }]"); + + MT("beginEndEquation", + "[tag \\begin][bracket {][atom equation][bracket }]", + " E=mc^2", + "[tag \\end][bracket {][atom equation][bracket }]"); + + MT("beginModule", + "[tag \\begin][bracket {][atom module][bracket }[[]]]"); + + MT("beginModuleId", + "[tag \\begin][bracket {][atom module][bracket }[[]id=bbt-size[bracket ]]]"); + + MT("importModule", + "[tag \\importmodule][bracket [[][string b-b-t][bracket ]]{][builtin b-b-t][bracket }]"); + + MT("importModulePath", + "[tag \\importmodule][bracket [[][tag \\KWARCslides][bracket {][string dmath/en/cardinality][bracket }]]{][builtin card][bracket }]"); + + MT("psForPDF", + "[tag \\PSforPDF][bracket [[][atom 1][bracket ]]{]#1[bracket }]"); + + MT("comment", + "[comment % foo]"); + + MT("tagComment", + "[tag \\item][comment % bar]"); + + MT("commentTag", + " [comment % \\item]"); + + MT("commentLineBreak", + "[comment %]", + "foo"); + + MT("tagErrorCurly", + "[tag \\begin][error }][bracket {]"); + + MT("tagErrorSquare", + "[tag \\item][error ]]][bracket {]"); + + MT("commentCurly", + "[comment % }]"); + + MT("tagHash", + "the [tag \\#] key"); + + MT("tagNumber", + "a [tag \\$][atom 5] stetson"); + + MT("tagPercent", + "[atom 100][tag \\%] beef"); + + MT("tagAmpersand", + "L [tag \\&] N"); + + MT("tagUnderscore", + "foo[tag \\_]bar"); + + MT("tagBracketOpen", + "[tag \\emph][bracket {][tag \\{][bracket }]"); + + MT("tagBracketClose", + "[tag \\emph][bracket {][tag \\}][bracket }]"); + + MT("tagLetterNumber", + "section [tag \\S][atom 1]"); + + MT("textTagNumber", + "para [tag \\P][atom 2]"); + + MT("thinspace", + "x[tag \\,]y"); + + MT("thickspace", + "x[tag \\;]y"); + + MT("negativeThinspace", + "x[tag \\!]y"); + + MT("periodNotSentence", + "J.\\ L.\\ is"); + + MT("periodSentence", + "X[tag \\@]. The"); + + MT("italicCorrection", + "[bracket {][tag \\em] If[tag \\/][bracket }] I"); + + MT("tagBracket", + "[tag \\newcommand][bracket {][tag \\pop][bracket }]"); + + MT("inlineMathTagFollowedByNumber", + "[keyword $][tag \\pi][number 2][keyword $]"); + + MT("inlineMath", + "[keyword $][number 3][variable-2 x][tag ^][number 2.45]-[tag \\sqrt][bracket {][tag \\$\\alpha][bracket }] = [number 2][keyword $] other text"); + + MT("displayMath", + "More [keyword $$]\t[variable-2 S][tag ^][variable-2 n][tag \\sum] [variable-2 i][keyword $$] other text"); + + MT("mathWithComment", + "[keyword $][variable-2 x] [comment % $]", + "[variable-2 y][keyword $] other text"); + + MT("lineBreakArgument", + "[tag \\\\][bracket [[][atom 1cm][bracket ]]]"); +})(); diff --git a/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/tcl/index.html b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/tcl/index.html new file mode 100644 index 000000000..e2e42a04b --- /dev/null +++ b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/tcl/index.html @@ -0,0 +1,129 @@ + + + + + CodeMirror: Tcl mode + + + + + + + +

CodeMirror: Tcl mode

+
+ + +

MIME types defined: text/x-tcl.

+ + + diff --git a/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/tcl/tcl.js b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/tcl/tcl.js new file mode 100644 index 000000000..ed2c69721 --- /dev/null +++ b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/tcl/tcl.js @@ -0,0 +1,131 @@ +//tcl mode by Ford_Lawnmower :: Based on Velocity mode by Steve O'Hara +CodeMirror.defineMode("tcl", 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("Tcl safe after append array auto_execok auto_import auto_load " + + "auto_mkindex auto_mkindex_old auto_qualify auto_reset bgerror " + + "binary break catch cd close concat continue dde eof encoding error " + + "eval exec exit expr fblocked fconfigure fcopy file fileevent filename " + + "filename flush for foreach format gets glob global history http if " + + "incr info interp join lappend lindex linsert list llength load lrange " + + "lreplace lsearch lset lsort memory msgcat namespace open package parray " + + "pid pkg::create pkg_mkIndex proc puts pwd re_syntax read regex regexp " + + "registry regsub rename resource return scan seek set socket source split " + + "string subst switch tcl_endOfWord tcl_findLibrary tcl_startOfNextWord " + + "tcl_wordBreakAfter tcl_startOfPreviousWord tcl_wordBreakBefore tcltest " + + "tclvars tell time trace unknown unset update uplevel upvar variable " + + "vwait"); + var functions = parseWords("if elseif else and not or eq ne in ni for foreach while switch"); + 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(); + if ((ch == '"' || ch == "'") && state.inParams) + return chain(stream, state, tokenString(ch)); + else if (/[\[\]{}\(\),;\.]/.test(ch)) { + if (ch == "(" && beforeParams) state.inParams = true; + else if (ch == ")") state.inParams = false; + return null; + } + else if (/\d/.test(ch)) { + stream.eatWhile(/[\w\.]/); + return "number"; + } + else if (ch == "#" && stream.eat("*")) { + return chain(stream, state, tokenComment); + } + else if (ch == "#" && stream.match(/ *\[ *\[/)) { + return chain(stream, state, tokenUnparsed); + } + else if (ch == "#" && stream.eat("#")) { + stream.skipToEnd(); + return "comment"; + } + else if (ch == '"') { + stream.skipTo(/"/); + return "comment"; + } + else if (ch == "$") { + stream.eatWhile(/[$_a-z0-9A-Z\.{:]/); + stream.eatWhile(/}/); + state.beforeParams = true; + return "builtin"; + } + else if (isOperatorChar.test(ch)) { + stream.eatWhile(isOperatorChar); + return "comment"; + } + else { + stream.eatWhile(/[\w\$_{}]/); + var word = stream.current().toLowerCase(); + if (keywords && keywords.propertyIsEnumerable(word)) + return "keyword"; + if (functions && functions.propertyIsEnumerable(word)) { + state.beforeParams = true; + return "keyword"; + } + 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"; + } + 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/x-tcl", "tcl"); diff --git a/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/tiddlywiki/index.html b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/tiddlywiki/index.html new file mode 100644 index 000000000..848f33a59 --- /dev/null +++ b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/tiddlywiki/index.html @@ -0,0 +1,142 @@ + + + + + CodeMirror: TiddlyWiki mode + + + + + + + + + +

CodeMirror: TiddlyWiki mode

+ +
+ + + +

TiddlyWiki mode supports a single configuration.

+ +

MIME types defined: text/x-tiddlywiki.

+ + diff --git a/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/tiddlywiki/tiddlywiki.css b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/tiddlywiki/tiddlywiki.css new file mode 100644 index 000000000..9a69b639f --- /dev/null +++ b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/tiddlywiki/tiddlywiki.css @@ -0,0 +1,14 @@ +span.cm-underlined { + text-decoration: underline; +} +span.cm-strikethrough { + text-decoration: line-through; +} +span.cm-brace { + color: #170; + font-weight: bold; +} +span.cm-table { + color: blue; + font-weight: bold; +} diff --git a/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/tiddlywiki/tiddlywiki.js b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/tiddlywiki/tiddlywiki.js new file mode 100644 index 000000000..095742d91 --- /dev/null +++ b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/tiddlywiki/tiddlywiki.js @@ -0,0 +1,337 @@ +CodeMirror.defineMode("tiddlywiki", function () { + // Tokenizer + var textwords = {}; + + var keywords = function () { + function kw(type) { + return { type: type, style: "macro"}; + } + return { + "allTags": kw('allTags'), "closeAll": kw('closeAll'), "list": kw('list'), + "newJournal": kw('newJournal'), "newTiddler": kw('newTiddler'), + "permaview": kw('permaview'), "saveChanges": kw('saveChanges'), + "search": kw('search'), "slider": kw('slider'), "tabs": kw('tabs'), + "tag": kw('tag'), "tagging": kw('tagging'), "tags": kw('tags'), + "tiddler": kw('tiddler'), "timeline": kw('timeline'), + "today": kw('today'), "version": kw('version'), "option": kw('option'), + + "with": kw('with'), + "filter": kw('filter') + }; + }(); + + var isSpaceName = /[\w_\-]/i, + reHR = /^\-\-\-\-+$/, //
+ reWikiCommentStart = /^\/\*\*\*$/, // /*** + reWikiCommentStop = /^\*\*\*\/$/, // ***/ + reBlockQuote = /^<<<$/, + + reJsCodeStart = /^\/\/\{\{\{$/, // //{{{ js block start + reJsCodeStop = /^\/\/\}\}\}$/, // //}}} js stop + reXmlCodeStart = /^$/, // xml block start + reXmlCodeStop = /^$/, // xml stop + + reCodeBlockStart = /^\{\{\{$/, // {{{ TW text div block start + reCodeBlockStop = /^\}\}\}$/, // }}} TW text stop + + reUntilCodeStop = /.*?\}\}\}/; + + function chain(stream, state, f) { + state.tokenize = f; + return f(stream, state); + } + + // Used as scratch variables to communicate multiple values without + // consing up tons of objects. + var type, content; + + function ret(tp, style, cont) { + type = tp; + content = cont; + return style; + } + + function jsTokenBase(stream, state) { + var sol = stream.sol(), ch; + + state.block = false; // indicates the start of a code block. + + ch = stream.peek(); // don't eat, to make matching simpler + + // check start of blocks + if (sol && /[<\/\*{}\-]/.test(ch)) { + if (stream.match(reCodeBlockStart)) { + state.block = true; + return chain(stream, state, twTokenCode); + } + if (stream.match(reBlockQuote)) { + return ret('quote', 'quote'); + } + if (stream.match(reWikiCommentStart) || stream.match(reWikiCommentStop)) { + return ret('code', 'comment'); + } + if (stream.match(reJsCodeStart) || stream.match(reJsCodeStop) || stream.match(reXmlCodeStart) || stream.match(reXmlCodeStop)) { + return ret('code', 'comment'); + } + if (stream.match(reHR)) { + return ret('hr', 'hr'); + } + } // sol + ch = stream.next(); + + if (sol && /[\/\*!#;:>|]/.test(ch)) { + if (ch == "!") { // tw header + stream.skipToEnd(); + return ret("header", "header"); + } + if (ch == "*") { // tw list + stream.eatWhile('*'); + return ret("list", "comment"); + } + if (ch == "#") { // tw numbered list + stream.eatWhile('#'); + return ret("list", "comment"); + } + if (ch == ";") { // definition list, term + stream.eatWhile(';'); + return ret("list", "comment"); + } + if (ch == ":") { // definition list, description + stream.eatWhile(':'); + return ret("list", "comment"); + } + if (ch == ">") { // single line quote + stream.eatWhile(">"); + return ret("quote", "quote"); + } + if (ch == '|') { + return ret('table', 'header'); + } + } + + if (ch == '{' && stream.match(/\{\{/)) { + return chain(stream, state, twTokenCode); + } + + // rudimentary html:// file:// link matching. TW knows much more ... + if (/[hf]/i.test(ch)) { + if (/[ti]/i.test(stream.peek()) && stream.match(/\b(ttps?|tp|ile):\/\/[\-A-Z0-9+&@#\/%?=~_|$!:,.;]*[A-Z0-9+&@#\/%=~_|$]/i)) { + return ret("link", "link"); + } + } + // just a little string indicator, don't want to have the whole string covered + if (ch == '"') { + return ret('string', 'string'); + } + if (ch == '~') { // _no_ CamelCase indicator should be bold + return ret('text', 'brace'); + } + if (/[\[\]]/.test(ch)) { // check for [[..]] + if (stream.peek() == ch) { + stream.next(); + return ret('brace', 'brace'); + } + } + if (ch == "@") { // check for space link. TODO fix @@...@@ highlighting + stream.eatWhile(isSpaceName); + return ret("link", "link"); + } + if (/\d/.test(ch)) { // numbers + stream.eatWhile(/\d/); + return ret("number", "number"); + } + if (ch == "/") { // tw invisible comment + if (stream.eat("%")) { + return chain(stream, state, twTokenComment); + } + else if (stream.eat("/")) { // + return chain(stream, state, twTokenEm); + } + } + if (ch == "_") { // tw underline + if (stream.eat("_")) { + return chain(stream, state, twTokenUnderline); + } + } + // strikethrough and mdash handling + if (ch == "-") { + if (stream.eat("-")) { + // if strikethrough looks ugly, change CSS. + if (stream.peek() != ' ') + return chain(stream, state, twTokenStrike); + // mdash + if (stream.peek() == ' ') + return ret('text', 'brace'); + } + } + if (ch == "'") { // tw bold + if (stream.eat("'")) { + return chain(stream, state, twTokenStrong); + } + } + if (ch == "<") { // tw macro + if (stream.eat("<")) { + return chain(stream, state, twTokenMacro); + } + } + else { + return ret(ch); + } + + // core macro handling + stream.eatWhile(/[\w\$_]/); + var word = stream.current(), + known = textwords.propertyIsEnumerable(word) && textwords[word]; + + return known ? ret(known.type, known.style, word) : ret("text", null, word); + + } // jsTokenBase() + + // tw invisible comment + function twTokenComment(stream, state) { + var maybeEnd = false, + ch; + while (ch = stream.next()) { + if (ch == "/" && maybeEnd) { + state.tokenize = jsTokenBase; + break; + } + maybeEnd = (ch == "%"); + } + return ret("comment", "comment"); + } + + // tw strong / bold + function twTokenStrong(stream, state) { + var maybeEnd = false, + ch; + while (ch = stream.next()) { + if (ch == "'" && maybeEnd) { + state.tokenize = jsTokenBase; + break; + } + maybeEnd = (ch == "'"); + } + return ret("text", "strong"); + } + + // tw code + function twTokenCode(stream, state) { + var ch, sb = state.block; + + if (sb && stream.current()) { + return ret("code", "comment"); + } + + if (!sb && stream.match(reUntilCodeStop)) { + state.tokenize = jsTokenBase; + return ret("code", "comment"); + } + + if (sb && stream.sol() && stream.match(reCodeBlockStop)) { + state.tokenize = jsTokenBase; + return ret("code", "comment"); + } + + ch = stream.next(); + return (sb) ? ret("code", "comment") : ret("code", "comment"); + } + + // tw em / italic + function twTokenEm(stream, state) { + var maybeEnd = false, + ch; + while (ch = stream.next()) { + if (ch == "/" && maybeEnd) { + state.tokenize = jsTokenBase; + break; + } + maybeEnd = (ch == "/"); + } + return ret("text", "em"); + } + + // tw underlined text + function twTokenUnderline(stream, state) { + var maybeEnd = false, + ch; + while (ch = stream.next()) { + if (ch == "_" && maybeEnd) { + state.tokenize = jsTokenBase; + break; + } + maybeEnd = (ch == "_"); + } + return ret("text", "underlined"); + } + + // tw strike through text looks ugly + // change CSS if needed + function twTokenStrike(stream, state) { + var maybeEnd = false, ch; + + while (ch = stream.next()) { + if (ch == "-" && maybeEnd) { + state.tokenize = jsTokenBase; + break; + } + maybeEnd = (ch == "-"); + } + return ret("text", "strikethrough"); + } + + // macro + function twTokenMacro(stream, state) { + var ch, word, known; + + if (stream.current() == '<<') { + return ret('brace', 'macro'); + } + + ch = stream.next(); + if (!ch) { + state.tokenize = jsTokenBase; + return ret(ch); + } + if (ch == ">") { + if (stream.peek() == '>') { + stream.next(); + state.tokenize = jsTokenBase; + return ret("brace", "macro"); + } + } + + stream.eatWhile(/[\w\$_]/); + word = stream.current(); + known = keywords.propertyIsEnumerable(word) && keywords[word]; + + if (known) { + return ret(known.type, known.style, word); + } + else { + return ret("macro", null, word); + } + } + + // Interface + return { + startState: function () { + return { + tokenize: jsTokenBase, + indented: 0, + level: 0 + }; + }, + + token: function (stream, state) { + if (stream.eatSpace()) return null; + var style = state.tokenize(stream, state); + return style; + }, + + electricChars: "" + }; +}); + +CodeMirror.defineMIME("text/x-tiddlywiki", "tiddlywiki"); +//}}} diff --git a/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/tiki/index.html b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/tiki/index.html new file mode 100644 index 000000000..7b85a44a7 --- /dev/null +++ b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/tiki/index.html @@ -0,0 +1,81 @@ + + + + CodeMirror: Tiki wiki mode + + + + + + + + +

CodeMirror: Tiki wiki mode

+ +
+ + + + + diff --git a/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/tiki/tiki.css b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/tiki/tiki.css new file mode 100644 index 000000000..0dbc3ea0e --- /dev/null +++ b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/tiki/tiki.css @@ -0,0 +1,26 @@ +.cm-tw-syntaxerror { + color: #FFF; + background-color: #900; +} + +.cm-tw-deleted { + text-decoration: line-through; +} + +.cm-tw-header5 { + font-weight: bold; +} +.cm-tw-listitem:first-child { /*Added first child to fix duplicate padding when highlighting*/ + padding-left: 10px; +} + +.cm-tw-box { + border-top-width: 0px ! important; + border-style: solid; + border-width: 1px; + border-color: inherit; +} + +.cm-tw-underline { + text-decoration: underline; +} \ No newline at end of file diff --git a/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/tiki/tiki.js b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/tiki/tiki.js new file mode 100644 index 000000000..e789163dc --- /dev/null +++ b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/tiki/tiki.js @@ -0,0 +1,308 @@ +CodeMirror.defineMode('tiki', function(config) { + function inBlock(style, terminator, returnTokenizer) { + return function(stream, state) { + while (!stream.eol()) { + if (stream.match(terminator)) { + state.tokenize = inText; + break; + } + stream.next(); + } + + if (returnTokenizer) state.tokenize = returnTokenizer; + + return style; + }; + } + + function inLine(style) { + return function(stream, state) { + while(!stream.eol()) { + stream.next(); + } + state.tokenize = inText; + return style; + }; + } + + function inText(stream, state) { + function chain(parser) { + state.tokenize = parser; + return parser(stream, state); + } + + var sol = stream.sol(); + var ch = stream.next(); + + //non start of line + switch (ch) { //switch is generally much faster than if, so it is used here + case "{": //plugin + stream.eat("/"); + stream.eatSpace(); + var tagName = ""; + var c; + while ((c = stream.eat(/[^\s\u00a0=\"\'\/?(}]/))) tagName += c; + state.tokenize = inPlugin; + return "tag"; + break; + case "_": //bold + if (stream.eat("_")) { + return chain(inBlock("strong", "__", inText)); + } + break; + case "'": //italics + if (stream.eat("'")) { + // Italic text + return chain(inBlock("em", "''", inText)); + } + break; + case "(":// Wiki Link + if (stream.eat("(")) { + return chain(inBlock("variable-2", "))", inText)); + } + break; + case "[":// Weblink + return chain(inBlock("variable-3", "]", inText)); + break; + case "|": //table + if (stream.eat("|")) { + return chain(inBlock("comment", "||")); + } + break; + case "-": + if (stream.eat("=")) {//titleBar + return chain(inBlock("header string", "=-", inText)); + } else if (stream.eat("-")) {//deleted + return chain(inBlock("error tw-deleted", "--", inText)); + } + break; + case "=": //underline + if (stream.match("==")) { + return chain(inBlock("tw-underline", "===", inText)); + } + break; + case ":": + if (stream.eat(":")) { + return chain(inBlock("comment", "::")); + } + break; + case "^": //box + return chain(inBlock("tw-box", "^")); + break; + case "~": //np + if (stream.match("np~")) { + return chain(inBlock("meta", "~/np~")); + } + break; + } + + //start of line types + if (sol) { + switch (ch) { + case "!": //header at start of line + if (stream.match('!!!!!')) { + return chain(inLine("header string")); + } else if (stream.match('!!!!')) { + return chain(inLine("header string")); + } else if (stream.match('!!!')) { + return chain(inLine("header string")); + } else if (stream.match('!!')) { + return chain(inLine("header string")); + } else { + return chain(inLine("header string")); + } + break; + case "*": //unordered list line item, or
  • at start of line + case "#": //ordered list line item, or
  • at start of line + case "+": //ordered list line item, or
  • at start of line + return chain(inLine("tw-listitem bracket")); + break; + } + } + + //stream.eatWhile(/[&{]/); was eating up plugins, turned off to act less like html and more like tiki + return null; + } + + var indentUnit = config.indentUnit; + + // Return variables for tokenizers + var pluginName, type; + function inPlugin(stream, state) { + var ch = stream.next(); + var peek = stream.peek(); + + if (ch == "}") { + state.tokenize = inText; + //type = ch == ")" ? "endPlugin" : "selfclosePlugin"; inPlugin + return "tag"; + } else if (ch == "(" || ch == ")") { + return "bracket"; + } else if (ch == "=") { + type = "equals"; + + if (peek == ">") { + ch = stream.next(); + peek = stream.peek(); + } + + //here we detect values directly after equal character with no quotes + if (!/[\'\"]/.test(peek)) { + state.tokenize = inAttributeNoQuote(); + } + //end detect values + + return "operator"; + } else if (/[\'\"]/.test(ch)) { + state.tokenize = inAttribute(ch); + return state.tokenize(stream, state); + } else { + stream.eatWhile(/[^\s\u00a0=\"\'\/?]/); + return "keyword"; + } + } + + function inAttribute(quote) { + return function(stream, state) { + while (!stream.eol()) { + if (stream.next() == quote) { + state.tokenize = inPlugin; + break; + } + } + return "string"; + }; + } + + function inAttributeNoQuote() { + return function(stream, state) { + while (!stream.eol()) { + var ch = stream.next(); + var peek = stream.peek(); + if (ch == " " || ch == "," || /[ )}]/.test(peek)) { + state.tokenize = inPlugin; + break; + } + } + return "string"; +}; + } + +var curState, 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(pluginName, startOfLine) { + var noIndent = curState.context && curState.context.noIndent; + curState.context = { + prev: curState.context, + pluginName: pluginName, + indent: curState.indented, + startOfLine: startOfLine, + noIndent: noIndent + }; +} + +function popContext() { + if (curState.context) curState.context = curState.context.prev; +} + +function element(type) { + if (type == "openPlugin") {curState.pluginName = pluginName; return cont(attributes, endplugin(curState.startOfLine));} + else if (type == "closePlugin") { + var err = false; + if (curState.context) { + err = curState.context.pluginName != pluginName; + popContext(); + } else { + err = true; + } + if (err) setStyle = "error"; + return cont(endcloseplugin(err)); + } + else if (type == "string") { + if (!curState.context || curState.context.name != "!cdata") pushContext("!cdata"); + if (curState.tokenize == inText) popContext(); + return cont(); + } + else return cont(); +} + +function endplugin(startOfLine) { + return function(type) { + if ( + type == "selfclosePlugin" || + type == "endPlugin" + ) + return cont(); + if (type == "endPlugin") {pushContext(curState.pluginName, startOfLine); return cont();} + return cont(); + }; +} + +function endcloseplugin(err) { + return function(type) { + if (err) setStyle = "error"; + if (type == "endPlugin") return cont(); + return pass(); + }; +} + +function attributes(type) { + if (type == "keyword") {setStyle = "attribute"; return cont(attributes);} + if (type == "equals") return cont(attvalue, attributes); + return pass(); +} +function attvalue(type) { + if (type == "keyword") {setStyle = "string"; return cont();} + if (type == "string") return cont(attvaluemaybe); + return pass(); +} +function attvaluemaybe(type) { + if (type == "string") return cont(attvaluemaybe); + else return pass(); +} +return { + startState: function() { + return {tokenize: inText, cc: [], indented: 0, startOfLine: true, pluginName: null, context: null}; + }, + token: function(stream, state) { + if (stream.sol()) { + state.startOfLine = true; + state.indented = stream.indentation(); + } + if (stream.eatSpace()) return null; + + setStyle = type = pluginName = null; + var style = state.tokenize(stream, state); + if ((style || type) && style != "comment") { + curState = state; + while (true) { + var comb = state.cc.pop() || element; + if (comb(type || style)) break; + } + } + state.startOfLine = false; + return setStyle || style; + }, + indent: function(state, textAfter) { + var context = state.context; + if (context && context.noIndent) return 0; + if (context && /^{\//.test(textAfter)) + context = context.prev; + while (context && !context.startOfLine) + context = context.prev; + if (context) return context.indent + indentUnit; + else return 0; + }, + electricChars: "/" + }; +}); + +CodeMirror.defineMIME("text/tiki", "tiki"); diff --git a/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/turtle/index.html b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/turtle/index.html new file mode 100644 index 000000000..5e56e5755 --- /dev/null +++ b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/turtle/index.html @@ -0,0 +1,39 @@ + + + + + CodeMirror: Turtle mode + + + + + + + +

    CodeMirror: Turtle mode

    +
    + + +

    MIME types defined: text/turtle.

    + + + diff --git a/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/turtle/turtle.js b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/turtle/turtle.js new file mode 100644 index 000000000..e118bfbce --- /dev/null +++ b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/turtle/turtle.js @@ -0,0 +1,145 @@ +CodeMirror.defineMode("turtle", function(config) { + var indentUnit = config.indentUnit; + var curPunc; + + function wordRegexp(words) { + return new RegExp("^(?:" + words.join("|") + ")$", "i"); + } + var ops = wordRegexp([]); + var keywords = wordRegexp(["@prefix", "@base", "a"]); + var operatorChars = /[*+\-<>=&|]/; + + function tokenBase(stream, state) { + var ch = stream.next(); + curPunc = null; + if (ch == "<" && !stream.match(/^[\s\u00a0=]/, false)) { + stream.match(/^[^\s\u00a0>]*>?/); + return "atom"; + } + else if (ch == "\"" || ch == "'") { + state.tokenize = tokenLiteral(ch); + return state.tokenize(stream, state); + } + else if (/[{}\(\),\.;\[\]]/.test(ch)) { + curPunc = ch; + return null; + } + else if (ch == "#") { + stream.skipToEnd(); + return "comment"; + } + else if (operatorChars.test(ch)) { + stream.eatWhile(operatorChars); + return null; + } + else if (ch == ":") { + return "operator"; + } else { + stream.eatWhile(/[_\w\d]/); + if(stream.peek() == ":") { + return "variable-3"; + } else { + var word = stream.current(); + + if(keywords.test(word)) { + return "meta"; + } + + if(ch >= "A" && ch <= "Z") { + return "comment"; + } else { + return "keyword"; + } + } + var word = stream.current(); + if (ops.test(word)) + return null; + else if (keywords.test(word)) + return "meta"; + else + return "variable"; + } + } + + function tokenLiteral(quote) { + return function(stream, state) { + var escaped = false, ch; + while ((ch = stream.next()) != null) { + if (ch == quote && !escaped) { + state.tokenize = tokenBase; + break; + } + escaped = !escaped && ch == "\\"; + } + 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/turtle", "turtle"); diff --git a/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/vb/LICENSE.txt b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/vb/LICENSE.txt new file mode 100644 index 000000000..60839703a --- /dev/null +++ b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/vb/LICENSE.txt @@ -0,0 +1,21 @@ +The MIT License + +Copyright (c) 2012 Codility Limited, 107 Cheapside, London EC2V 6DN, UK + +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/vb/index.html b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/vb/index.html new file mode 100644 index 000000000..74dd5e816 --- /dev/null +++ b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/vb/index.html @@ -0,0 +1,88 @@ + + + + CodeMirror: VB.NET mode + + + + + + + + + +

    CodeMirror: VB.NET mode

    + + + +
    + +
    +
    
    +  

    MIME type defined: text/x-vb.

    + + diff --git a/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/vb/vb.js b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/vb/vb.js new file mode 100644 index 000000000..27b227195 --- /dev/null +++ b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/vb/vb.js @@ -0,0 +1,259 @@ +CodeMirror.defineMode("vb", function(conf, parserConf) { + var ERRORCLASS = 'error'; + + function wordRegexp(words) { + return new RegExp("^((" + words.join(")|(") + "))\\b", "i"); + } + + var singleOperators = new RegExp("^[\\+\\-\\*/%&\\\\|\\^~<>!]"); + var singleDelimiters = new RegExp('^[\\(\\)\\[\\]\\{\\}@,:`=;\\.]'); + var doubleOperators = new RegExp("^((==)|(<>)|(<=)|(>=)|(<>)|(<<)|(>>)|(//)|(\\*\\*))"); + var doubleDelimiters = new RegExp("^((\\+=)|(\\-=)|(\\*=)|(%=)|(/=)|(&=)|(\\|=)|(\\^=))"); + var tripleDelimiters = new RegExp("^((//=)|(>>=)|(<<=)|(\\*\\*=))"); + var identifiers = new RegExp("^[_A-Za-z][_A-Za-z0-9]*"); + + var openingKeywords = ['class','module', 'sub','enum','select','while','if','function', 'get','set','property', 'try']; + var middleKeywords = ['else','elseif','case', 'catch']; + var endKeywords = ['next','loop']; + + var wordOperators = wordRegexp(['and', 'or', 'not', 'xor', 'in']); + var commonkeywords = ['as', 'dim', 'break', 'continue','optional', 'then', 'until', + 'goto', 'byval','byref','new','handles','property', 'return', + 'const','private', 'protected', 'friend', 'public', 'shared', 'static', 'true','false']; + var commontypes = ['integer','string','double','decimal','boolean','short','char', 'float','single']; + + var keywords = wordRegexp(commonkeywords); + var types = wordRegexp(commontypes); + var stringPrefixes = '"'; + + var opening = wordRegexp(openingKeywords); + var middle = wordRegexp(middleKeywords); + var closing = wordRegexp(endKeywords); + var doubleClosing = wordRegexp(['end']); + var doOpening = wordRegexp(['do']); + + var indentInfo = null; + + + + + function indent(_stream, state) { + state.currentIndent++; + } + + function dedent(_stream, state) { + state.currentIndent--; + } + // tokenizers + function tokenBase(stream, state) { + if (stream.eatSpace()) { + return null; + } + + var ch = stream.peek(); + + // Handle Comments + if (ch === "'") { + stream.skipToEnd(); + return 'comment'; + } + + + // Handle Number Literals + if (stream.match(/^((&H)|(&O))?[0-9\.a-f]/i, false)) { + var floatLiteral = false; + // Floats + if (stream.match(/^\d*\.\d+F?/i)) { floatLiteral = true; } + else if (stream.match(/^\d+\.\d*F?/)) { floatLiteral = true; } + else if (stream.match(/^\.\d+F?/)) { floatLiteral = true; } + + if (floatLiteral) { + // Float literals may be "imaginary" + stream.eat(/J/i); + return 'number'; + } + // Integers + var intLiteral = false; + // Hex + if (stream.match(/^&H[0-9a-f]+/i)) { intLiteral = true; } + // Octal + else if (stream.match(/^&O[0-7]+/i)) { intLiteral = true; } + // Decimal + else if (stream.match(/^[1-9]\d*F?/)) { + // Decimal literals may be "imaginary" + stream.eat(/J/i); + // TODO - Can you have imaginary longs? + intLiteral = true; + } + // Zero by itself with no other piece of number. + else if (stream.match(/^0(?![\dx])/i)) { intLiteral = true; } + if (intLiteral) { + // Integer literals may be "long" + stream.eat(/L/i); + return 'number'; + } + } + + // Handle Strings + if (stream.match(stringPrefixes)) { + state.tokenize = tokenStringFactory(stream.current()); + return state.tokenize(stream, state); + } + + // Handle operators and Delimiters + if (stream.match(tripleDelimiters) || stream.match(doubleDelimiters)) { + return null; + } + if (stream.match(doubleOperators) + || stream.match(singleOperators) + || stream.match(wordOperators)) { + return 'operator'; + } + if (stream.match(singleDelimiters)) { + return null; + } + if (stream.match(doOpening)) { + indent(stream,state); + state.doInCurrentLine = true; + return 'keyword'; + } + if (stream.match(opening)) { + if (! state.doInCurrentLine) + indent(stream,state); + else + state.doInCurrentLine = false; + return 'keyword'; + } + if (stream.match(middle)) { + return 'keyword'; + } + + if (stream.match(doubleClosing)) { + dedent(stream,state); + dedent(stream,state); + return 'keyword'; + } + if (stream.match(closing)) { + dedent(stream,state); + return 'keyword'; + } + + if (stream.match(types)) { + return 'keyword'; + } + + if (stream.match(keywords)) { + return 'keyword'; + } + + if (stream.match(identifiers)) { + return 'variable'; + } + + // Handle non-detected items + stream.next(); + return ERRORCLASS; + } + + function tokenStringFactory(delimiter) { + var singleline = delimiter.length == 1; + var OUTCLASS = 'string'; + + return function(stream, state) { + while (!stream.eol()) { + stream.eatWhile(/[^'"]/); + if (stream.match(delimiter)) { + state.tokenize = tokenBase; + return OUTCLASS; + } else { + stream.eat(/['"]/); + } + } + if (singleline) { + if (parserConf.singleLineStringErrors) { + return ERRORCLASS; + } else { + state.tokenize = tokenBase; + } + } + return OUTCLASS; + }; + } + + + function tokenLexer(stream, state) { + var style = state.tokenize(stream, state); + var current = stream.current(); + + // Handle '.' connected identifiers + if (current === '.') { + style = state.tokenize(stream, state); + current = stream.current(); + if (style === 'variable') { + return 'variable'; + } else { + return ERRORCLASS; + } + } + + + var delimiter_index = '[({'.indexOf(current); + if (delimiter_index !== -1) { + indent(stream, state ); + } + if (indentInfo === 'dedent') { + if (dedent(stream, state)) { + return ERRORCLASS; + } + } + delimiter_index = '])}'.indexOf(current); + if (delimiter_index !== -1) { + if (dedent(stream, state)) { + return ERRORCLASS; + } + } + + return style; + } + + var external = { + electricChars:"dDpPtTfFeE ", + startState: function() { + return { + tokenize: tokenBase, + lastToken: null, + currentIndent: 0, + nextLineIndent: 0, + doInCurrentLine: false + + + }; + }, + + token: function(stream, state) { + if (stream.sol()) { + state.currentIndent += state.nextLineIndent; + state.nextLineIndent = 0; + state.doInCurrentLine = 0; + } + var style = tokenLexer(stream, state); + + state.lastToken = {style:style, content: stream.current()}; + + + + return style; + }, + + indent: function(state, textAfter) { + var trueText = textAfter.replace(/^\s+|\s+$/g, '') ; + if (trueText.match(closing) || trueText.match(doubleClosing) || trueText.match(middle)) return conf.indentUnit*(state.currentIndent-1); + if(state.currentIndent < 0) return 0; + return state.currentIndent * conf.indentUnit; + } + + }; + return external; +}); + +CodeMirror.defineMIME("text/x-vb", "vb"); diff --git a/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/vbscript/index.html b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/vbscript/index.html new file mode 100644 index 000000000..8c86f9ef9 --- /dev/null +++ b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/vbscript/index.html @@ -0,0 +1,42 @@ + + + + + CodeMirror: VBScript mode + + + + + + + +

    CodeMirror: VBScript mode

    + +
    + + + +

    MIME types defined: text/vbscript.

    + + + diff --git a/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/vbscript/vbscript.js b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/vbscript/vbscript.js new file mode 100644 index 000000000..3e1eedc7d --- /dev/null +++ b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/vbscript/vbscript.js @@ -0,0 +1,26 @@ +CodeMirror.defineMode("vbscript", function() { + var regexVBScriptKeyword = /^(?:Call|Case|CDate|Clear|CInt|CLng|Const|CStr|Description|Dim|Do|Each|Else|ElseIf|End|Err|Error|Exit|False|For|Function|If|LCase|Loop|LTrim|Next|Nothing|Now|Number|On|Preserve|Quit|ReDim|Resume|RTrim|Select|Set|Sub|Then|To|Trim|True|UBound|UCase|Until|VbCr|VbCrLf|VbLf|VbTab)$/im; + + return { + token: function(stream) { + if (stream.eatSpace()) return null; + var ch = stream.next(); + if (ch == "'") { + stream.skipToEnd(); + return "comment"; + } + if (ch == '"') { + stream.skipTo('"'); + return "string"; + } + + if (/\w/.test(ch)) { + stream.eatWhile(/\w/); + if (regexVBScriptKeyword.test(stream.current())) return "keyword"; + } + return null; + } + }; +}); + +CodeMirror.defineMIME("text/vbscript", "vbscript"); diff --git a/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/velocity/index.html b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/velocity/index.html new file mode 100644 index 000000000..fb59cb590 --- /dev/null +++ b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/velocity/index.html @@ -0,0 +1,103 @@ + + + + + CodeMirror: Velocity mode + + + + + + + + +

    CodeMirror: Velocity mode

    +
    + + +

    MIME types defined: text/velocity.

    + + + 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.

    + +

    MIME types defined: text/x-verilog (Verilog code).

    + + diff --git a/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/verilog/verilog.js b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/verilog/verilog.js new file mode 100644 index 000000000..708de23f4 --- /dev/null +++ b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/verilog/verilog.js @@ -0,0 +1,182 @@ +CodeMirror.defineMode("verilog", function(config, parserConfig) { + var indentUnit = config.indentUnit, + keywords = parserConfig.keywords || {}, + blockKeywords = parserConfig.blockKeywords || {}, + atoms = parserConfig.atoms || {}, + hooks = parserConfig.hooks || {}, + multiLineStrings = parserConfig.multiLineStrings; + var isOperatorChar = /[&|~> + + + + CodeMirror: XML mode + + + + + + + +

    CodeMirror: XML mode

    +
    + +

    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. +

    + + + diff --git a/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/xquery/test.js b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/xquery/test.js new file mode 100644 index 000000000..41719dd16 --- /dev/null +++ b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/xquery/test.js @@ -0,0 +1,64 @@ +// Don't take these too seriously -- the expected results appear to be +// based on the results of actual runs without any serious manual +// verification. If a change you made causes them to fail, the test is +// as likely to wrong as the code. + +(function() { + var mode = CodeMirror.getMode({tabSize: 4}, "xquery"); + function MT(name) { test.mode(name, mode, Array.prototype.slice.call(arguments, 1)); } + + MT("eviltest", + "[keyword xquery] [keyword version] [variable "1][keyword .][atom 0][keyword -][variable ml"][def&variable ;] [comment (: this is : a \"comment\" :)]", + " [keyword let] [variable $let] [keyword :=] [variable <x] [variable attr][keyword =][variable "value">"test"<func>][def&variable ;function]() [variable $var] {[keyword function]()} {[variable $var]}[variable <][keyword /][variable func><][keyword /][variable x>]", + " [keyword let] [variable $joe][keyword :=][atom 1]", + " [keyword return] [keyword element] [variable element] {", + " [keyword attribute] [variable attribute] { [atom 1] },", + " [keyword element] [variable test] { [variable 'a'] }, [keyword attribute] [variable foo] { [variable "bar"] },", + " [def&variable fn:doc]()[[ [variable foo][keyword /][variable @bar] [keyword eq] [variable $let] ]],", + " [keyword //][variable x] } [comment (: a more 'evil' test :)]", + " [comment (: Modified Blakeley example (: with nested comment :) ... :)]", + " [keyword declare] [keyword private] [keyword function] [def&variable local:declare]() {()}[variable ;]", + " [keyword declare] [keyword private] [keyword function] [def&variable local:private]() {()}[variable ;]", + " [keyword declare] [keyword private] [keyword function] [def&variable local:function]() {()}[variable ;]", + " [keyword declare] [keyword private] [keyword function] [def&variable local:local]() {()}[variable ;]", + " [keyword let] [variable $let] [keyword :=] [variable <let>let] [variable $let] [keyword :=] [variable "let"<][keyword /let][variable >]", + " [keyword return] [keyword element] [variable element] {", + " [keyword attribute] [variable attribute] { [keyword try] { [def&variable xdmp:version]() } [keyword catch]([variable $e]) { [def&variable xdmp:log]([variable $e]) } },", + " [keyword attribute] [variable fn:doc] { [variable "bar"] [variable castable] [keyword as] [atom xs:string] },", + " [keyword element] [variable text] { [keyword text] { [variable "text"] } },", + " [def&variable fn:doc]()[[ [qualifier child::][variable eq][keyword /]([variable @bar] [keyword |] [qualifier attribute::][variable attribute]) [keyword eq] [variable $let] ]],", + " [keyword //][variable fn:doc]", + " }"); + + MT("testEmptySequenceKeyword", + "[string \"foo\"] [keyword instance] [keyword of] [keyword empty-sequence]()"); + + MT("testMultiAttr", + "[tag

    ][variable hello] [variable world][tag

    ]"); + + MT("test namespaced variable", + "[keyword declare] [keyword namespace] [variable e] [keyword =] [string \"http://example.com/ANamespace\"][variable ;declare] [keyword variable] [variable $e:exampleComThisVarIsNotRecognized] [keyword as] [keyword element]([keyword *]) [variable external;]"); + + MT("test EQName variable", + "[keyword declare] [keyword variable] [variable $\"http://www.example.com/ns/my\":var] [keyword :=] [atom 12][variable ;]", + "[tag ]{[variable $\"http://www.example.com/ns/my\":var]}[tag ]"); + + MT("test EQName function", + "[keyword declare] [keyword function] [def&variable \"http://www.example.com/ns/my\":fn] ([variable $a] [keyword as] [atom xs:integer]) [keyword as] [atom xs:integer] {", + " [variable $a] [keyword +] [atom 2]", + "}[variable ;]", + "[tag ]{[def&variable \"http://www.example.com/ns/my\":fn]([atom 12])}[tag ]"); + + MT("test EQName function with single quotes", + "[keyword declare] [keyword function] [def&variable 'http://www.example.com/ns/my':fn] ([variable $a] [keyword as] [atom xs:integer]) [keyword as] [atom xs:integer] {", + " [variable $a] [keyword +] [atom 2]", + "}[variable ;]", + "[tag ]{[def&variable 'http://www.example.com/ns/my':fn]([atom 12])}[tag ]"); + + MT("testProcessingInstructions", + "[def&variable data]([comment&meta ]) [keyword instance] [keyword of] [atom xs:string]"); + + MT("testQuoteEscapeDouble", + "[keyword let] [variable $rootfolder] [keyword :=] [string \"c:\\builds\\winnt\\HEAD\\qa\\scripts\\\"]", + "[keyword let] [variable $keysfolder] [keyword :=] [def&variable concat]([variable $rootfolder], [string \"keys\\\"])"); +})(); diff --git a/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/xquery/xquery.js b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/xquery/xquery.js new file mode 100644 index 000000000..7cb27e976 --- /dev/null +++ b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/xquery/xquery.js @@ -0,0 +1,428 @@ +CodeMirror.defineMode("xquery", function() { + + // The keywords object is set to the result of this self executing + // function. Each keyword is a property of the keywords object whose + // value is {type: atype, style: astyle} + var keywords = function(){ + // conveinence functions used to build keywords object + function kw(type) {return {type: type, style: "keyword"};} + var A = kw("keyword a") + , B = kw("keyword b") + , C = kw("keyword c") + , operator = kw("operator") + , atom = {type: "atom", style: "atom"} + , punctuation = {type: "punctuation", style: null} + , qualifier = {type: "axis_specifier", style: "qualifier"}; + + // kwObj is what is return from this function at the end + var kwObj = { + 'if': A, 'switch': A, 'while': A, 'for': A, + 'else': B, 'then': B, 'try': B, 'finally': B, 'catch': B, + 'element': C, 'attribute': C, 'let': C, 'implements': C, 'import': C, 'module': C, 'namespace': C, + 'return': C, 'super': C, 'this': C, 'throws': C, 'where': C, 'private': C, + ',': punctuation, + 'null': atom, 'fn:false()': atom, 'fn:true()': atom + }; + + // a list of 'basic' keywords. For each add a property to kwObj with the value of + // {type: basic[i], style: "keyword"} e.g. 'after' --> {type: "after", style: "keyword"} + var basic = ['after','ancestor','ancestor-or-self','and','as','ascending','assert','attribute','before', + 'by','case','cast','child','comment','declare','default','define','descendant','descendant-or-self', + 'descending','document','document-node','element','else','eq','every','except','external','following', + 'following-sibling','follows','for','function','if','import','in','instance','intersect','item', + 'let','module','namespace','node','node','of','only','or','order','parent','precedes','preceding', + 'preceding-sibling','processing-instruction','ref','return','returns','satisfies','schema','schema-element', + 'self','some','sortby','stable','text','then','to','treat','typeswitch','union','variable','version','where', + 'xquery', 'empty-sequence']; + for(var i=0, l=basic.length; i < l; i++) { kwObj[basic[i]] = kw(basic[i]);}; + + // a list of types. For each add a property to kwObj with the value of + // {type: "atom", style: "atom"} + var types = ['xs:string', 'xs:float', 'xs:decimal', 'xs:double', 'xs:integer', 'xs:boolean', 'xs:date', 'xs:dateTime', + 'xs:time', 'xs:duration', 'xs:dayTimeDuration', 'xs:time', 'xs:yearMonthDuration', 'numeric', 'xs:hexBinary', + 'xs:base64Binary', 'xs:anyURI', 'xs:QName', 'xs:byte','xs:boolean','xs:anyURI','xf:yearMonthDuration']; + for(var i=0, l=types.length; i < l; i++) { kwObj[types[i]] = atom;}; + + // each operator will add a property to kwObj with value of {type: "operator", style: "keyword"} + var operators = ['eq', 'ne', 'lt', 'le', 'gt', 'ge', ':=', '=', '>', '>=', '<', '<=', '.', '|', '?', 'and', 'or', 'div', 'idiv', 'mod', '*', '/', '+', '-']; + for(var i=0, l=operators.length; i < l; i++) { kwObj[operators[i]] = operator;}; + + // each axis_specifiers will add a property to kwObj with value of {type: "axis_specifier", style: "qualifier"} + var axis_specifiers = ["self::", "attribute::", "child::", "descendant::", "descendant-or-self::", "parent::", + "ancestor::", "ancestor-or-self::", "following::", "preceding::", "following-sibling::", "preceding-sibling::"]; + for(var i=0, l=axis_specifiers.length; i < l; i++) { kwObj[axis_specifiers[i]] = qualifier; }; + + return kwObj; + }(); + + // Used as scratch variables to communicate multiple values without + // consing up tons of objects. + var type, content; + + function ret(tp, style, cont) { + type = tp; content = cont; + return style; + } + + function chain(stream, state, f) { + state.tokenize = f; + return f(stream, state); + } + + // the primary mode tokenizer + function tokenBase(stream, state) { + var ch = stream.next(), + mightBeFunction = false, + isEQName = isEQNameAhead(stream); + + // an XML tag (if not in some sub, chained tokenizer) + if (ch == "<") { + if(stream.match("!--", true)) + return chain(stream, state, tokenXMLComment); + + if(stream.match("![CDATA", false)) { + state.tokenize = tokenCDATA; + return ret("tag", "tag"); + } + + if(stream.match("?", false)) { + return chain(stream, state, tokenPreProcessing); + } + + var isclose = stream.eat("/"); + stream.eatSpace(); + var tagName = "", c; + while ((c = stream.eat(/[^\s\u00a0=<>\"\'\/?]/))) tagName += c; + + return chain(stream, state, tokenTag(tagName, isclose)); + } + // start code block + else if(ch == "{") { + pushStateStack(state,{ type: "codeblock"}); + return ret("", null); + } + // end code block + else if(ch == "}") { + popStateStack(state); + return ret("", null); + } + // if we're in an XML block + else if(isInXmlBlock(state)) { + if(ch == ">") + return ret("tag", "tag"); + else if(ch == "/" && stream.eat(">")) { + popStateStack(state); + return ret("tag", "tag"); + } + else + return ret("word", "variable"); + } + // if a number + else if (/\d/.test(ch)) { + stream.match(/^\d*(?:\.\d*)?(?:E[+\-]?\d+)?/); + return ret("number", "atom"); + } + // comment start + else if (ch === "(" && stream.eat(":")) { + pushStateStack(state, { type: "comment"}); + return chain(stream, state, tokenComment); + } + // quoted string + else if ( !isEQName && (ch === '"' || ch === "'")) + return chain(stream, state, tokenString(ch)); + // variable + else if(ch === "$") { + return chain(stream, state, tokenVariable); + } + // assignment + else if(ch ===":" && stream.eat("=")) { + return ret("operator", "keyword"); + } + // open paren + else if(ch === "(") { + pushStateStack(state, { type: "paren"}); + return ret("", null); + } + // close paren + else if(ch === ")") { + popStateStack(state); + return ret("", null); + } + // open paren + else if(ch === "[") { + pushStateStack(state, { type: "bracket"}); + return ret("", null); + } + // close paren + else if(ch === "]") { + popStateStack(state); + return ret("", null); + } + else { + var known = keywords.propertyIsEnumerable(ch) && keywords[ch]; + + // if there's a EQName ahead, consume the rest of the string portion, it's likely a function + if(isEQName && ch === '\"') while(stream.next() !== '"'){} + if(isEQName && ch === '\'') while(stream.next() !== '\''){} + + // gobble up a word if the character is not known + if(!known) stream.eatWhile(/[\w\$_-]/); + + // gobble a colon in the case that is a lib func type call fn:doc + var foundColon = stream.eat(":"); + + // if there's not a second colon, gobble another word. Otherwise, it's probably an axis specifier + // which should get matched as a keyword + if(!stream.eat(":") && foundColon) { + stream.eatWhile(/[\w\$_-]/); + } + // if the next non whitespace character is an open paren, this is probably a function (if not a keyword of other sort) + if(stream.match(/^[ \t]*\(/, false)) { + mightBeFunction = true; + } + // is the word a keyword? + var word = stream.current(); + known = keywords.propertyIsEnumerable(word) && keywords[word]; + + // if we think it's a function call but not yet known, + // set style to variable for now for lack of something better + if(mightBeFunction && !known) known = {type: "function_call", style: "variable def"}; + + // if the previous word was element, attribute, axis specifier, this word should be the name of that + if(isInXmlConstructor(state)) { + popStateStack(state); + return ret("word", "variable", word); + } + // as previously checked, if the word is element,attribute, axis specifier, call it an "xmlconstructor" and + // push the stack so we know to look for it on the next word + if(word == "element" || word == "attribute" || known.type == "axis_specifier") pushStateStack(state, {type: "xmlconstructor"}); + + // if the word is known, return the details of that else just call this a generic 'word' + return known ? ret(known.type, known.style, word) : + ret("word", "variable", word); + } + } + + // handle comments, including nested + function tokenComment(stream, state) { + var maybeEnd = false, maybeNested = false, nestedCount = 0, ch; + while (ch = stream.next()) { + if (ch == ")" && maybeEnd) { + if(nestedCount > 0) + nestedCount--; + else { + popStateStack(state); + break; + } + } + else if(ch == ":" && maybeNested) { + nestedCount++; + } + maybeEnd = (ch == ":"); + maybeNested = (ch == "("); + } + + return ret("comment", "comment"); + } + + // tokenizer for string literals + // optionally pass a tokenizer function to set state.tokenize back to when finished + function tokenString(quote, f) { + return function(stream, state) { + var ch; + + if(isInString(state) && stream.current() == quote) { + popStateStack(state); + if(f) state.tokenize = f; + return ret("string", "string"); + } + + pushStateStack(state, { type: "string", name: quote, tokenize: tokenString(quote, f) }); + + // if we're in a string and in an XML block, allow an embedded code block + if(stream.match("{", false) && isInXmlAttributeBlock(state)) { + state.tokenize = tokenBase; + return ret("string", "string"); + } + + + while (ch = stream.next()) { + if (ch == quote) { + popStateStack(state); + if(f) state.tokenize = f; + break; + } + else { + // if we're in a string and in an XML block, allow an embedded code block in an attribute + if(stream.match("{", false) && isInXmlAttributeBlock(state)) { + state.tokenize = tokenBase; + return ret("string", "string"); + } + + } + } + + return ret("string", "string"); + }; + } + + // tokenizer for variables + function tokenVariable(stream, state) { + var isVariableChar = /[\w\$_-]/; + + // a variable may start with a quoted EQName so if the next character is quote, consume to the next quote + if(stream.eat("\"")) { + while(stream.next() !== '\"'){}; + stream.eat(":"); + } else { + stream.eatWhile(isVariableChar); + if(!stream.match(":=", false)) stream.eat(":"); + } + stream.eatWhile(isVariableChar); + state.tokenize = tokenBase; + return ret("variable", "variable"); + } + + // tokenizer for XML tags + function tokenTag(name, isclose) { + return function(stream, state) { + stream.eatSpace(); + if(isclose && stream.eat(">")) { + popStateStack(state); + state.tokenize = tokenBase; + return ret("tag", "tag"); + } + // self closing tag without attributes? + if(!stream.eat("/")) + pushStateStack(state, { type: "tag", name: name, tokenize: tokenBase}); + if(!stream.eat(">")) { + state.tokenize = tokenAttribute; + return ret("tag", "tag"); + } + else { + state.tokenize = tokenBase; + } + return ret("tag", "tag"); + }; + } + + // tokenizer for XML attributes + function tokenAttribute(stream, state) { + var ch = stream.next(); + + if(ch == "/" && stream.eat(">")) { + if(isInXmlAttributeBlock(state)) popStateStack(state); + if(isInXmlBlock(state)) popStateStack(state); + return ret("tag", "tag"); + } + if(ch == ">") { + if(isInXmlAttributeBlock(state)) popStateStack(state); + return ret("tag", "tag"); + } + if(ch == "=") + return ret("", null); + // quoted string + if (ch == '"' || ch == "'") + return chain(stream, state, tokenString(ch, tokenAttribute)); + + if(!isInXmlAttributeBlock(state)) + pushStateStack(state, { type: "attribute", name: name, tokenize: tokenAttribute}); + + stream.eat(/[a-zA-Z_:]/); + stream.eatWhile(/[-a-zA-Z0-9_:.]/); + stream.eatSpace(); + + // the case where the attribute has not value and the tag was closed + if(stream.match(">", false) || stream.match("/", false)) { + popStateStack(state); + state.tokenize = tokenBase; + } + + return ret("attribute", "attribute"); + } + + // handle comments, including nested + function tokenXMLComment(stream, state) { + var ch; + while (ch = stream.next()) { + if (ch == "-" && stream.match("->", true)) { + state.tokenize = tokenBase; + return ret("comment", "comment"); + } + } + } + + + // handle CDATA + function tokenCDATA(stream, state) { + var ch; + while (ch = stream.next()) { + if (ch == "]" && stream.match("]", true)) { + state.tokenize = tokenBase; + return ret("comment", "comment"); + } + } + } + + // handle preprocessing instructions + function tokenPreProcessing(stream, state) { + var ch; + while (ch = stream.next()) { + if (ch == "?" && stream.match(">", true)) { + state.tokenize = tokenBase; + return ret("comment", "comment meta"); + } + } + } + + + // functions to test the current context of the state + function isInXmlBlock(state) { return isIn(state, "tag"); } + function isInXmlAttributeBlock(state) { return isIn(state, "attribute"); } + function isInXmlConstructor(state) { return isIn(state, "xmlconstructor"); } + function isInString(state) { return isIn(state, "string"); } + + function isEQNameAhead(stream) { + // assume we've already eaten a quote (") + if(stream.current() === '"') + return stream.match(/^[^\"]+\"\:/, false); + else if(stream.current() === '\'') + return stream.match(/^[^\"]+\'\:/, false); + else + return false; + } + + function isIn(state, type) { + return (state.stack.length && state.stack[state.stack.length - 1].type == type); + } + + function pushStateStack(state, newState) { + state.stack.push(newState); + } + + function popStateStack(state) { + state.stack.pop(); + var reinstateTokenize = state.stack.length && state.stack[state.stack.length-1].tokenize; + state.tokenize = reinstateTokenize || tokenBase; + } + + // the interface for the mode API + return { + startState: function() { + return { + tokenize: tokenBase, + cc: [], + stack: [] + }; + }, + + token: function(stream, state) { + if (stream.eatSpace()) return null; + var style = state.tokenize(stream, state); + return style; + } + }; + +}); + +CodeMirror.defineMIME("application/xquery", "xquery"); diff --git a/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/yaml/index.html b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/yaml/index.html new file mode 100644 index 000000000..65e1ea73f --- /dev/null +++ b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/yaml/index.html @@ -0,0 +1,68 @@ + + + + + CodeMirror: YAML mode + + + + + + + +

    CodeMirror: YAML mode

    +
    + + +

    MIME types defined: text/x-yaml.

    + + + diff --git a/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/yaml/yaml.js b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/yaml/yaml.js new file mode 100644 index 000000000..7a095b31d --- /dev/null +++ b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/yaml/yaml.js @@ -0,0 +1,97 @@ +CodeMirror.defineMode("yaml", function() { + + var cons = ['true', 'false', 'on', 'off', 'yes', 'no']; + var keywordRegex = new RegExp("\\b(("+cons.join(")|(")+"))$", 'i'); + + return { + token: function(stream, state) { + var ch = stream.peek(); + var esc = state.escaped; + state.escaped = false; + /* comments */ + if (ch == "#" && (stream.pos == 0 || /\s/.test(stream.string.charAt(stream.pos - 1)))) { + stream.skipToEnd(); return "comment"; + } + if (state.literal && stream.indentation() > state.keyCol) { + stream.skipToEnd(); return "string"; + } else if (state.literal) { state.literal = false; } + if (stream.sol()) { + state.keyCol = 0; + state.pair = false; + state.pairStart = false; + /* document start */ + if(stream.match(/---/)) { return "def"; } + /* document end */ + if (stream.match(/\.\.\./)) { return "def"; } + /* array list item */ + if (stream.match(/\s*-\s+/)) { return 'meta'; } + } + /* pairs (associative arrays) -> key */ + if (!state.pair && stream.match(/^\s*([a-z0-9\._-])+(?=\s*:)/i)) { + state.pair = true; + state.keyCol = stream.indentation(); + return "atom"; + } + if (state.pair && stream.match(/^:\s*/)) { state.pairStart = true; return 'meta'; } + + /* inline pairs/lists */ + if (stream.match(/^(\{|\}|\[|\])/)) { + if (ch == '{') + state.inlinePairs++; + else if (ch == '}') + state.inlinePairs--; + else if (ch == '[') + state.inlineList++; + else + state.inlineList--; + return 'meta'; + } + + /* list seperator */ + if (state.inlineList > 0 && !esc && ch == ',') { + stream.next(); + return 'meta'; + } + /* pairs seperator */ + if (state.inlinePairs > 0 && !esc && ch == ',') { + state.keyCol = 0; + state.pair = false; + state.pairStart = false; + stream.next(); + return 'meta'; + } + + /* start of value of a pair */ + if (state.pairStart) { + /* block literals */ + if (stream.match(/^\s*(\||\>)\s*/)) { state.literal = true; return 'meta'; }; + /* references */ + if (stream.match(/^\s*(\&|\*)[a-z0-9\._-]+\b/i)) { return 'variable-2'; } + /* numbers */ + if (state.inlinePairs == 0 && stream.match(/^\s*-?[0-9\.\,]+\s?$/)) { return 'number'; } + if (state.inlinePairs > 0 && stream.match(/^\s*-?[0-9\.\,]+\s?(?=(,|}))/)) { return 'number'; } + /* keywords */ + if (stream.match(keywordRegex)) { return 'keyword'; } + } + + /* nothing found, continue */ + state.pairStart = false; + state.escaped = (ch == '\\'); + stream.next(); + return null; + }, + startState: function() { + return { + pair: false, + pairStart: false, + keyCol: 0, + inlinePairs: 0, + inlineList: 0, + literal: false, + escaped: false + }; + } + }; +}); + +CodeMirror.defineMIME("text/x-yaml", "yaml"); diff --git a/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/z80/index.html b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/z80/index.html new file mode 100644 index 000000000..133c870e3 --- /dev/null +++ b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/z80/index.html @@ -0,0 +1,39 @@ + + + + + CodeMirror: Z80 assembly mode + + + + + + + +

    CodeMirror: Z80 assembly mode

    + +
    + + + +

    MIME type defined: text/x-z80.

    + + diff --git a/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/z80/z80.js b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/z80/z80.js new file mode 100644 index 000000000..ff43d32b5 --- /dev/null +++ b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/z80/z80.js @@ -0,0 +1,85 @@ +CodeMirror.defineMode('z80', function() { + var keywords1 = /^(exx?|(ld|cp|in)([di]r?)?|pop|push|ad[cd]|cpl|daa|dec|inc|neg|sbc|sub|and|bit|[cs]cf|x?or|res|set|r[lr]c?a?|r[lr]d|s[lr]a|srl|djnz|nop|rst|[de]i|halt|im|ot[di]r|out[di]?)\b/i; + var keywords2 = /^(call|j[pr]|ret[in]?)\b/i; + var keywords3 = /^b_?(call|jump)\b/i; + var variables1 = /^(af?|bc?|c|de?|e|hl?|l|i[xy]?|r|sp)\b/i; + var variables2 = /^(n?[zc]|p[oe]?|m)\b/i; + var errors = /^([hl][xy]|i[xy][hl]|slia|sll)\b/i; + var numbers = /^([\da-f]+h|[0-7]+o|[01]+b|\d+)\b/i; + + return { + startState: function() { + return {context: 0}; + }, + token: function(stream, state) { + if (!stream.column()) + state.context = 0; + + if (stream.eatSpace()) + return null; + + var w; + + if (stream.eatWhile(/\w/)) { + w = stream.current(); + + if (stream.indentation()) { + if (state.context == 1 && variables1.test(w)) + return 'variable-2'; + + if (state.context == 2 && variables2.test(w)) + return 'variable-3'; + + if (keywords1.test(w)) { + state.context = 1; + return 'keyword'; + } else if (keywords2.test(w)) { + state.context = 2; + return 'keyword'; + } else if (keywords3.test(w)) { + state.context = 3; + return 'keyword'; + } + + if (errors.test(w)) + return 'error'; + } else if (numbers.test(w)) { + return 'number'; + } else { + return null; + } + } else if (stream.eat(';')) { + stream.skipToEnd(); + return 'comment'; + } else if (stream.eat('"')) { + while (w = stream.next()) { + if (w == '"') + break; + + if (w == '\\') + stream.next(); + } + return 'string'; + } else if (stream.eat('\'')) { + if (stream.match(/\\?.'/)) + return 'number'; + } else if (stream.eat('.') || stream.sol() && stream.eat('#')) { + state.context = 4; + + if (stream.eatWhile(/\w/)) + return 'def'; + } else if (stream.eat('$')) { + if (stream.eatWhile(/[\da-f]/i)) + return 'number'; + } else if (stream.eat('%')) { + if (stream.eatWhile(/[01]/)) + return 'number'; + } else { + stream.next(); + } + return null; + } + }; +}); + +CodeMirror.defineMIME("text/x-z80", "z80"); diff --git a/MixERP.Net.FrontEnd/Scripts/CodeMirror/package.json b/MixERP.Net.FrontEnd/Scripts/CodeMirror/package.json new file mode 100644 index 000000000..9cc8a6962 --- /dev/null +++ b/MixERP.Net.FrontEnd/Scripts/CodeMirror/package.json @@ -0,0 +1,19 @@ +{ + "name": "codemirror", + "version":"3.14.0", + "main": "lib/codemirror.js", + "description": "In-browser code editing made bearable", + "licenses": [{"type": "MIT", + "url": "http://codemirror.net/LICENSE"}], + "directories": {"lib": "./lib"}, + "scripts": {"test": "node ./test/run.js"}, + "devDependencies": {"node-static": "0.6.0"}, + "bugs": "http://github.com/marijnh/CodeMirror/issues", + "keywords": ["JavaScript", "CodeMirror", "Editor"], + "homepage": "http://codemirror.net", + "maintainers":[{"name": "Marijn Haverbeke", + "email": "marijnh@gmail.com", + "web": "http://marijnhaverbeke.nl"}], + "repository": {"type": "git", + "url": "http://marijnhaverbeke.nl/git/codemirror"} +} diff --git a/MixERP.Net.FrontEnd/Scripts/CodeMirror/test/comment_test.js b/MixERP.Net.FrontEnd/Scripts/CodeMirror/test/comment_test.js new file mode 100644 index 000000000..7ab3127b4 --- /dev/null +++ b/MixERP.Net.FrontEnd/Scripts/CodeMirror/test/comment_test.js @@ -0,0 +1,51 @@ +namespace = "comment_"; + +(function() { + function test(name, mode, run, before, after) { + return testCM(name, function(cm) { + run(cm); + eq(cm.getValue(), after); + }, {value: before, mode: mode}); + } + + var simpleProg = "function foo() {\n return bar;\n}"; + + test("block", "javascript", function(cm) { + cm.blockComment(Pos(0, 3), Pos(3, 0), {blockCommentLead: " *"}); + }, simpleProg + "\n", "/* function foo() {\n * return bar;\n * }\n */"); + + test("blockToggle", "javascript", function(cm) { + cm.blockComment(Pos(0, 3), Pos(2, 0), {blockCommentLead: " *"}); + cm.uncomment(Pos(0, 3), Pos(2, 0), {blockCommentLead: " *"}); + }, simpleProg, simpleProg); + + test("line", "javascript", function(cm) { + cm.lineComment(Pos(1, 1), Pos(1, 1)); + }, simpleProg, "function foo() {\n// return bar;\n}"); + + test("lineToggle", "javascript", function(cm) { + cm.lineComment(Pos(0, 0), Pos(2, 1)); + cm.uncomment(Pos(0, 0), Pos(2, 1)); + }, simpleProg, simpleProg); + + test("fallbackToBlock", "css", function(cm) { + cm.lineComment(Pos(0, 0), Pos(2, 1)); + }, "html {\n border: none;\n}", "/* html {\n border: none;\n} */"); + + test("fallbackToLine", "ruby", function(cm) { + cm.blockComment(Pos(0, 0), Pos(1)); + }, "def blah()\n return hah\n", "# def blah()\n# return hah\n"); + + test("commentRange", "javascript", function(cm) { + cm.blockComment(Pos(1, 2), Pos(1, 13), {fullLines: false}); + }, simpleProg, "function foo() {\n /*return bar;*/\n}"); + + test("indented", "javascript", function(cm) { + cm.lineComment(Pos(1, 0), Pos(2), {indent: true}); + }, simpleProg, "function foo() {\n // return bar;\n // }"); + + test("singleEmptyLine", "javascript", function(cm) { + cm.setCursor(1); + cm.execCommand("toggleComment"); + }, "a;\n\nb;", "a;\n// \nb;"); +})(); diff --git a/MixERP.Net.FrontEnd/Scripts/CodeMirror/test/doc_test.js b/MixERP.Net.FrontEnd/Scripts/CodeMirror/test/doc_test.js new file mode 100644 index 000000000..3e04e155b --- /dev/null +++ b/MixERP.Net.FrontEnd/Scripts/CodeMirror/test/doc_test.js @@ -0,0 +1,329 @@ +(function() { + // A minilanguage for instantiating linked CodeMirror instances and Docs + function instantiateSpec(spec, place, opts) { + var names = {}, pos = 0, l = spec.length, editors = []; + while (spec) { + var m = spec.match(/^(\w+)(\*?)(?:='([^\']*)'|<(~?)(\w+)(?:\/(\d+)-(\d+))?)\s*/); + var name = m[1], isDoc = m[2], cur; + if (m[3]) { + cur = isDoc ? CodeMirror.Doc(m[3]) : CodeMirror(place, clone(opts, {value: m[3]})); + } else { + var other = m[5]; + if (!names.hasOwnProperty(other)) { + names[other] = editors.length; + editors.push(CodeMirror(place, opts)); + } + var doc = editors[names[other]].linkedDoc({ + sharedHist: !m[4], + from: m[6] ? Number(m[6]) : null, + to: m[7] ? Number(m[7]) : null + }); + cur = isDoc ? doc : CodeMirror(place, clone(opts, {value: doc})); + } + names[name] = editors.length; + editors.push(cur); + spec = spec.slice(m[0].length); + } + return editors; + } + + function clone(obj, props) { + if (!obj) return; + clone.prototype = obj; + var inst = new clone(); + if (props) for (var n in props) if (props.hasOwnProperty(n)) + inst[n] = props[n]; + return inst; + } + + function eqAll(val) { + var end = arguments.length, msg = null; + if (typeof arguments[end-1] == "string") + msg = arguments[--end]; + if (i == end) throw new Error("No editors provided to eqAll"); + for (var i = 1; i < end; ++i) + eq(arguments[i].getValue(), val, msg) + } + + function testDoc(name, spec, run, opts, expectFail) { + if (!opts) opts = {}; + + return test("doc_" + name, function() { + var place = document.getElementById("testground"); + var editors = instantiateSpec(spec, place, opts); + var successful = false; + + try { + run.apply(null, editors); + successful = true; + } finally { + if ((debug && !successful) || verbose) { + place.style.visibility = "visible"; + } else { + for (var i = 0; i < editors.length; ++i) + if (editors[i] instanceof CodeMirror) + place.removeChild(editors[i].getWrapperElement()); + } + } + }, expectFail); + } + + var ie_lt8 = /MSIE [1-7]\b/.test(navigator.userAgent); + + function testBasic(a, b) { + eqAll("x", a, b); + a.setValue("hey"); + eqAll("hey", a, b); + b.setValue("wow"); + eqAll("wow", a, b); + a.replaceRange("u\nv\nw", Pos(0, 3)); + b.replaceRange("i", Pos(0, 4)); + b.replaceRange("j", Pos(2, 1)); + eqAll("wowui\nv\nwj", a, b); + } + + testDoc("basic", "A='x' B 0, "not at left"); + is(pos.top > 0, "not at top"); + }); + + testDoc("copyDoc", "A='u'", function(a) { + var copy = a.getDoc().copy(true); + a.setValue("foo"); + copy.setValue("bar"); + var old = a.swapDoc(copy); + eq(a.getValue(), "bar"); + a.undo(); + eq(a.getValue(), "u"); + a.swapDoc(old); + eq(a.getValue(), "foo"); + eq(old.historySize().undo, 1); + eq(old.copy(false).historySize().undo, 0); + }); + + testDoc("docKeepsMode", "A='1+1'", function(a) { + var other = CodeMirror.Doc("hi", "text/x-markdown"); + a.setOption("mode", "text/javascript"); + var old = a.swapDoc(other); + eq(a.getOption("mode"), "text/x-markdown"); + eq(a.getMode().name, "markdown"); + a.swapDoc(old); + eq(a.getOption("mode"), "text/javascript"); + eq(a.getMode().name, "javascript"); + }); + + testDoc("subview", "A='1\n2\n3\n4\n5' B<~A/1-3", function(a, b) { + eq(b.getValue(), "2\n3"); + eq(b.firstLine(), 1); + b.setCursor(Pos(4)); + eqPos(b.getCursor(), Pos(2, 1)); + a.replaceRange("-1\n0\n", Pos(0, 0)); + eq(b.firstLine(), 3); + eqPos(b.getCursor(), Pos(4, 1)); + a.undo(); + eqPos(b.getCursor(), Pos(2, 1)); + b.replaceRange("oyoy\n", Pos(2, 0)); + eq(a.getValue(), "1\n2\noyoy\n3\n4\n5"); + b.undo(); + eq(a.getValue(), "1\n2\n3\n4\n5"); + }); + + testDoc("subviewEditOnBoundary", "A='11\n22\n33\n44\n55' B<~A/1-4", function(a, b) { + a.replaceRange("x\nyy\nz", Pos(0, 1), Pos(2, 1)); + eq(b.firstLine(), 2); + eq(b.lineCount(), 2); + eq(b.getValue(), "z3\n44"); + a.replaceRange("q\nrr\ns", Pos(3, 1), Pos(4, 1)); + eq(b.firstLine(), 2); + eq(b.getValue(), "z3\n4q"); + eq(a.getValue(), "1x\nyy\nz3\n4q\nrr\ns5"); + a.execCommand("selectAll"); + a.replaceSelection("!"); + eqAll("!", a, b); + }); + + + testDoc("sharedMarker", "A='ab\ncd\nef\ngh' B 500){ + totalTime = 0; + delay = 50; + } + setTimeout(function(){step(i + 1);}, delay); + } else { // Quit tests + running = false; + return null; + } + } + step(0); +} + +function label(str, msg) { + if (msg) return str + " (" + msg + ")"; + return str; +} +function eq(a, b, msg) { + if (a != b) throw new Failure(label(a + " != " + b, msg)); +} +function eqPos(a, b, msg) { + function str(p) { return "{line:" + p.line + ",ch:" + p.ch + "}"; } + if (a == b) return; + if (a == null) throw new Failure(label("comparing null to " + str(b), msg)); + if (b == null) throw new Failure(label("comparing " + str(a) + " to null", msg)); + if (a.line != b.line || a.ch != b.ch) throw new Failure(label(str(a) + " != " + str(b), msg)); +} +function is(a, msg) { + if (!a) throw new Failure(label("assertion failed", msg)); +} + +function countTests() { + if (!debug) return tests.length; + var sum = 0; + for (var i = 0; i < tests.length; ++i) { + var name = tests[i].name; + if (indexOf(debug, name) != -1 || + indexOf(debug, name.split("_")[0] + "_*") != -1) + ++sum; + } + return sum; +} diff --git a/MixERP.Net.FrontEnd/Scripts/CodeMirror/test/emacs_test.js b/MixERP.Net.FrontEnd/Scripts/CodeMirror/test/emacs_test.js new file mode 100644 index 000000000..ab18241de --- /dev/null +++ b/MixERP.Net.FrontEnd/Scripts/CodeMirror/test/emacs_test.js @@ -0,0 +1,135 @@ +(function() { + "use strict"; + + var Pos = CodeMirror.Pos; + namespace = "emacs_"; + + var eventCache = {}; + function fakeEvent(keyName) { + var event = eventCache[key]; + if (event) return event; + + var ctrl, shift, alt; + var key = keyName.replace(/\w+-/g, function(type) { + if (type == "Ctrl-") ctrl = true; + else if (type == "Alt-") alt = true; + else if (type == "Shift-") shift = true; + return ""; + }); + var code; + for (var c in CodeMirror.keyNames) + if (CodeMirror.keyNames[c] == key) { code = c; break; } + if (c == null) throw new Error("Unknown key: " + key); + + return eventCache[keyName] = { + type: "keydown", keyCode: code, ctrlKey: ctrl, shiftKey: shift, altKey: alt, + preventDefault: function(){}, stopPropagation: function(){} + }; + } + + function sim(name, start /*, actions... */) { + var keys = Array.prototype.slice.call(arguments, 2); + testCM(name, function(cm) { + for (var i = 0; i < keys.length; ++i) { + var cur = keys[i]; + if (cur instanceof Pos) cm.setCursor(cur); + else if (cur.call) cur(cm); + else cm.triggerOnKeyDown(fakeEvent(cur)); + } + }, {keyMap: "emacs", value: start, mode: "javascript"}); + } + + function at(line, ch) { return function(cm) { eqPos(cm.getCursor(), Pos(line, ch)); }; } + function txt(str) { return function(cm) { eq(cm.getValue(), str); }; } + + sim("motionHSimple", "abc", "Ctrl-F", "Ctrl-F", "Ctrl-B", at(0, 1)); + sim("motionHMulti", "abcde", + "Ctrl-4", "Ctrl-F", at(0, 4), "Ctrl--", "Ctrl-2", "Ctrl-F", at(0, 2), + "Ctrl-5", "Ctrl-B", at(0, 0)); + + sim("motionHWord", "abc. def ghi", + "Alt-F", at(0, 3), "Alt-F", at(0, 8), + "Ctrl-B", "Alt-B", at(0, 5), "Alt-B", at(0, 0)); + sim("motionHWordMulti", "abc. def ghi ", + "Ctrl-3", "Alt-F", at(0, 12), "Ctrl-2", "Alt-B", at(0, 5), + "Ctrl--", "Alt-B", at(0, 8)); + + sim("motionVSimple", "a\nb\nc\n", "Ctrl-N", "Ctrl-N", "Ctrl-P", at(1, 0)); + sim("motionVMulti", "a\nb\nc\nd\ne\n", + "Ctrl-2", "Ctrl-N", at(2, 0), "Ctrl-F", "Ctrl--", "Ctrl-N", at(1, 1), + "Ctrl--", "Ctrl-3", "Ctrl-P", at(4, 1)); + + sim("killYank", "abc\ndef\nghi", + "Ctrl-F", "Ctrl-Space", "Ctrl-N", "Ctrl-N", "Ctrl-W", "Ctrl-E", "Ctrl-Y", + txt("ahibc\ndef\ng")); + sim("killRing", "abcdef", + "Ctrl-Space", "Ctrl-F", "Ctrl-W", "Ctrl-Space", "Ctrl-F", "Ctrl-W", + "Ctrl-Y", "Alt-Y", + txt("acdef")); + sim("copyYank", "abcd", + "Ctrl-Space", "Ctrl-E", "Alt-W", "Ctrl-Y", + txt("abcdabcd")); + + sim("killLineSimple", "foo\nbar", "Ctrl-F", "Ctrl-K", txt("f\nbar")); + sim("killLineEmptyLine", "foo\n \nbar", "Ctrl-N", "Ctrl-K", txt("foo\nbar")); + sim("killLineMulti", "foo\nbar\nbaz", + "Ctrl-F", "Ctrl-F", "Ctrl-K", "Ctrl-K", "Ctrl-K", "Ctrl-A", "Ctrl-Y", + txt("o\nbarfo\nbaz")); + + sim("moveByParagraph", "abc\ndef\n\n\nhij\nklm\n\n", + "Ctrl-F", "Ctrl-Down", at(2, 0), "Ctrl-Down", at(6, 0), + "Ctrl-N", "Ctrl-Up", at(3, 0), "Ctrl-Up", at(0, 0), + Pos(1, 2), "Ctrl-Down", at(2, 0), Pos(4, 2), "Ctrl-Up", at(3, 0)); + sim("moveByParagraphMulti", "abc\n\ndef\n\nhij\n\nklm", + "Ctrl-U", "2", "Ctrl-Down", at(3, 0), + "Shift-Alt-.", "Ctrl-3", "Ctrl-Up", at(1, 0)); + + sim("moveBySentence", "sentence one! sentence\ntwo\n\nparagraph two", + "Alt-E", at(0, 13), "Alt-E", at(1, 3), "Ctrl-F", "Alt-A", at(0, 13)); + + sim("moveByExpr", "function foo(a, b) {}", + "Ctrl-Alt-F", at(0, 8), "Ctrl-Alt-F", at(0, 12), "Ctrl-Alt-F", at(0, 18), + "Ctrl-Alt-B", at(0, 12), "Ctrl-Alt-B", at(0, 9)); + sim("moveByExprMulti", "foo bar baz bug", + "Ctrl-2", "Ctrl-Alt-F", at(0, 7), + "Ctrl--", "Ctrl-Alt-F", at(0, 4), + "Ctrl--", "Ctrl-2", "Ctrl-Alt-B", at(0, 11)); + sim("delExpr", "var x = [\n a,\n b\n c\n];", + Pos(0, 8), "Ctrl-Alt-K", txt("var x = ;"), "Ctrl-/", + Pos(4, 1), "Ctrl-Alt-Backspace", txt("var x = ;")); + sim("delExprMulti", "foo bar baz", + "Ctrl-2", "Ctrl-Alt-K", txt(" baz"), + "Ctrl-/", "Ctrl-E", "Ctrl-2", "Ctrl-Alt-Backspace", txt("foo ")); + + sim("justOneSpace", "hi bye ", + Pos(0, 4), "Alt-Space", txt("hi bye "), + Pos(0, 4), "Alt-Space", txt("hi b ye "), + "Ctrl-A", "Alt-Space", "Ctrl-E", "Alt-Space", txt(" hi b ye ")); + + sim("openLine", "foo bar", "Alt-F", "Ctrl-O", txt("foo\n bar")) + + sim("transposeChar", "abcd\n\ne", + "Ctrl-F", "Ctrl-T", "Ctrl-T", txt("bcad\n\ne"), at(0, 3), + "Ctrl-F", "Ctrl-T", "Ctrl-T", "Ctrl-T", txt("bcda\n\ne"), at(0, 4), + "Ctrl-F", "Ctrl-T", txt("bcd\na\ne"), at(1, 1)); + + sim("manipWordCase", "foo BAR bAZ", + "Alt-C", "Alt-L", "Alt-U", txt("Foo bar BAZ"), + "Ctrl-A", "Alt-U", "Alt-L", "Alt-C", txt("FOO bar Baz")); + sim("manipWordCaseMulti", "foo Bar bAz", + "Ctrl-2", "Alt-U", txt("FOO BAR bAz"), + "Ctrl-A", "Ctrl-3", "Alt-C", txt("Foo Bar Baz")); + + sim("upExpr", "foo {\n bar[];\n baz(blah);\n}", + Pos(2, 7), "Ctrl-Alt-U", at(2, 5), "Ctrl-Alt-U", at(0, 4)); + sim("transposeExpr", "do foo[bar] dah", + Pos(0, 6), "Ctrl-Alt-T", txt("do [bar]foo dah")); + + testCM("save", function(cm) { + var saved = false; + CodeMirror.commands.save = function(cm) { saved = cm.getValue(); }; + cm.triggerOnKeyDown(fakeEvent("Ctrl-X")); + cm.triggerOnKeyDown(fakeEvent("Ctrl-S")); + is(saved, "hi"); + }, {value: "hi", keyMap: "emacs"}); +})(); diff --git a/MixERP.Net.FrontEnd/Scripts/CodeMirror/test/index.html b/MixERP.Net.FrontEnd/Scripts/CodeMirror/test/index.html new file mode 100644 index 000000000..4a827e643 --- /dev/null +++ b/MixERP.Net.FrontEnd/Scripts/CodeMirror/test/index.html @@ -0,0 +1,195 @@ + + + + + CodeMirror: Test Suite + + + + + + + + + + + + + + + + + + +

    CodeMirror: Test Suite

    + +

    A limited set of programmatic sanity tests for CodeMirror.

    + +
    +
    Ran 0 of 0 tests
    +
    +

    Please enable JavaScript...

    +
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/MixERP.Net.FrontEnd/Scripts/CodeMirror/test/lint/acorn.js b/MixERP.Net.FrontEnd/Scripts/CodeMirror/test/lint/acorn.js new file mode 100644 index 000000000..68e1c4f0c --- /dev/null +++ b/MixERP.Net.FrontEnd/Scripts/CodeMirror/test/lint/acorn.js @@ -0,0 +1,1578 @@ +(function(exports) { + "use strict"; + + exports.version = "0.0.1"; + + // The main exported interface (under `window.acorn` when in the + // browser) is a `parse` function that takes a code string and + // returns an abstract syntax tree as specified by [Mozilla parser + // API][api], with the caveat that the SpiderMonkey-specific syntax + // (`let`, `yield`, inline XML, etc) is not recognized. + // + // [api]: https://developer.mozilla.org/en-US/docs/SpiderMonkey/Parser_API + + var options, input, inputLen, sourceFile; + + exports.parse = function(inpt, opts) { + input = String(inpt); inputLen = input.length; + options = opts || {}; + for (var opt in defaultOptions) if (!options.hasOwnProperty(opt)) + options[opt] = defaultOptions[opt]; + sourceFile = options.sourceFile || null; + return parseTopLevel(options.program); + }; + + // A second optional argument can be given to further configure + // the parser process. These options are recognized: + + var defaultOptions = exports.defaultOptions = { + // `ecmaVersion` indicates the ECMAScript version to parse. Must + // be either 3 or 5. This + // influences support for strict mode, the set of reserved words, and + // support for getters and setter. + ecmaVersion: 5, + // Turn on `strictSemicolons` to prevent the parser from doing + // automatic semicolon insertion. + strictSemicolons: false, + // When `allowTrailingCommas` is false, the parser will not allow + // trailing commas in array and object literals. + allowTrailingCommas: true, + // By default, reserved words are not enforced. Enable + // `forbidReserved` to enforce them. + forbidReserved: false, + // When `trackComments` is turned on, the parser will attach + // `commentsBefore` and `commentsAfter` properties to AST nodes + // holding arrays of strings. A single comment may appear in both + // a `commentsBefore` and `commentsAfter` array (of the nodes + // after and before it), but never twice in the before (or after) + // array of different nodes. + trackComments: false, + // When `locations` is on, `loc` properties holding objects with + // `start` and `end` properties in `{line, column}` form (with + // line being 1-based and column 0-based) will be attached to the + // nodes. + locations: false, + // Nodes have their start and end characters offsets recorded in + // `start` and `end` properties (directly on the node, rather than + // the `loc` object, which holds line/column data. To also add a + // [semi-standardized][range] `range` property holding a `[start, + // end]` array with the same numbers, set the `ranges` option to + // `true`. + // + // [range]: https://bugzilla.mozilla.org/show_bug.cgi?id=745678 + ranges: false, + // It is possible to parse multiple files into a single AST by + // passing the tree produced by parsing the first file as + // `program` option in subsequent parses. This will add the + // toplevel forms of the parsed file to the `Program` (top) node + // of an existing parse tree. + program: null, + // When `location` is on, you can pass this to record the source + // file in every node's `loc` object. + sourceFile: null + }; + + // The `getLineInfo` function is mostly useful when the + // `locations` option is off (for performance reasons) and you + // want to find the line/column position for a given character + // offset. `input` should be the code string that the offset refers + // into. + + var getLineInfo = exports.getLineInfo = function(input, offset) { + for (var line = 1, cur = 0;;) { + lineBreak.lastIndex = cur; + var match = lineBreak.exec(input); + if (match && match.index < offset) { + ++line; + cur = match.index + match[0].length; + } else break; + } + return {line: line, column: offset - cur}; + }; + + // Acorn is organized as a tokenizer and a recursive-descent parser. + // Both use (closure-)global variables to keep their state and + // communicate. We already saw the `options`, `input`, and + // `inputLen` variables above (set in `parse`). + + // The current position of the tokenizer in the input. + + var tokPos; + + // The start and end offsets of the current token. + + var tokStart, tokEnd; + + // When `options.locations` is true, these hold objects + // containing the tokens start and end line/column pairs. + + var tokStartLoc, tokEndLoc; + + // The type and value of the current token. Token types are objects, + // named by variables against which they can be compared, and + // holding properties that describe them (indicating, for example, + // the precedence of an infix operator, and the original name of a + // keyword token). The kind of value that's held in `tokVal` depends + // on the type of the token. For literals, it is the literal value, + // for operators, the operator name, and so on. + + var tokType, tokVal; + + // These are used to hold arrays of comments when + // `options.trackComments` is true. + + var tokCommentsBefore, tokCommentsAfter; + + // Interal state for the tokenizer. To distinguish between division + // operators and regular expressions, it remembers whether the last + // token was one that is allowed to be followed by an expression. + // (If it is, a slash is probably a regexp, if it isn't it's a + // division operator. See the `parseStatement` function for a + // caveat.) + + var tokRegexpAllowed, tokComments; + + // When `options.locations` is true, these are used to keep + // track of the current line, and know when a new line has been + // entered. See the `curLineLoc` function. + + var tokCurLine, tokLineStart, tokLineStartNext; + + // These store the position of the previous token, which is useful + // when finishing a node and assigning its `end` position. + + var lastStart, lastEnd, lastEndLoc; + + // This is the parser's state. `inFunction` is used to reject + // `return` statements outside of functions, `labels` to verify that + // `break` and `continue` have somewhere to jump to, and `strict` + // indicates whether strict mode is on. + + var inFunction, labels, strict; + + // This function is used to raise exceptions on parse errors. It + // takes either a `{line, column}` object or an offset integer (into + // the current `input`) as `pos` argument. It attaches the position + // to the end of the error message, and then raises a `SyntaxError` + // with that message. + + function raise(pos, message) { + if (typeof pos == "number") pos = getLineInfo(input, pos); + message += " (" + pos.line + ":" + pos.column + ")"; + throw new SyntaxError(message); + } + + // ## Token types + + // The assignment of fine-grained, information-carrying type objects + // allows the tokenizer to store the information it has about a + // token in a way that is very cheap for the parser to look up. + + // All token type variables start with an underscore, to make them + // easy to recognize. + + // These are the general types. The `type` property is only used to + // make them recognizeable when debugging. + + var _num = {type: "num"}, _regexp = {type: "regexp"}, _string = {type: "string"}; + var _name = {type: "name"}, _eof = {type: "eof"}; + + // Keyword tokens. The `keyword` property (also used in keyword-like + // operators) indicates that the token originated from an + // identifier-like word, which is used when parsing property names. + // + // The `beforeExpr` property is used to disambiguate between regular + // expressions and divisions. It is set on all token types that can + // be followed by an expression (thus, a slash after them would be a + // regular expression). + // + // `isLoop` marks a keyword as starting a loop, which is important + // to know when parsing a label, in order to allow or disallow + // continue jumps to that label. + + var _break = {keyword: "break"}, _case = {keyword: "case", beforeExpr: true}, _catch = {keyword: "catch"}; + var _continue = {keyword: "continue"}, _debugger = {keyword: "debugger"}, _default = {keyword: "default"}; + var _do = {keyword: "do", isLoop: true}, _else = {keyword: "else", beforeExpr: true}; + var _finally = {keyword: "finally"}, _for = {keyword: "for", isLoop: true}, _function = {keyword: "function"}; + var _if = {keyword: "if"}, _return = {keyword: "return", beforeExpr: true}, _switch = {keyword: "switch"}; + var _throw = {keyword: "throw", beforeExpr: true}, _try = {keyword: "try"}, _var = {keyword: "var"}; + var _while = {keyword: "while", isLoop: true}, _with = {keyword: "with"}, _new = {keyword: "new", beforeExpr: true}; + var _this = {keyword: "this"}; + + // The keywords that denote values. + + var _null = {keyword: "null", atomValue: null}, _true = {keyword: "true", atomValue: true}; + var _false = {keyword: "false", atomValue: false}; + + // Some keywords are treated as regular operators. `in` sometimes + // (when parsing `for`) needs to be tested against specifically, so + // we assign a variable name to it for quick comparing. + + var _in = {keyword: "in", binop: 7, beforeExpr: true}; + + // Map keyword names to token types. + + var keywordTypes = {"break": _break, "case": _case, "catch": _catch, + "continue": _continue, "debugger": _debugger, "default": _default, + "do": _do, "else": _else, "finally": _finally, "for": _for, + "function": _function, "if": _if, "return": _return, "switch": _switch, + "throw": _throw, "try": _try, "var": _var, "while": _while, "with": _with, + "null": _null, "true": _true, "false": _false, "new": _new, "in": _in, + "instanceof": {keyword: "instanceof", binop: 7}, "this": _this, + "typeof": {keyword: "typeof", prefix: true}, + "void": {keyword: "void", prefix: true}, + "delete": {keyword: "delete", prefix: true}}; + + // Punctuation token types. Again, the `type` property is purely for debugging. + + var _bracketL = {type: "[", beforeExpr: true}, _bracketR = {type: "]"}, _braceL = {type: "{", beforeExpr: true}; + var _braceR = {type: "}"}, _parenL = {type: "(", beforeExpr: true}, _parenR = {type: ")"}; + var _comma = {type: ",", beforeExpr: true}, _semi = {type: ";", beforeExpr: true}; + var _colon = {type: ":", beforeExpr: true}, _dot = {type: "."}, _question = {type: "?", beforeExpr: true}; + + // Operators. These carry several kinds of properties to help the + // parser use them properly (the presence of these properties is + // what categorizes them as operators). + // + // `binop`, when present, specifies that this operator is a binary + // operator, and will refer to its precedence. + // + // `prefix` and `postfix` mark the operator as a prefix or postfix + // unary operator. `isUpdate` specifies that the node produced by + // the operator should be of type UpdateExpression rather than + // simply UnaryExpression (`++` and `--`). + // + // `isAssign` marks all of `=`, `+=`, `-=` etcetera, which act as + // binary operators with a very low precedence, that should result + // in AssignmentExpression nodes. + + var _slash = {binop: 10, beforeExpr: true}, _eq = {isAssign: true, beforeExpr: true}; + var _assign = {isAssign: true, beforeExpr: true}, _plusmin = {binop: 9, prefix: true, beforeExpr: true}; + var _incdec = {postfix: true, prefix: true, isUpdate: true}, _prefix = {prefix: true, beforeExpr: true}; + var _bin1 = {binop: 1, beforeExpr: true}, _bin2 = {binop: 2, beforeExpr: true}; + var _bin3 = {binop: 3, beforeExpr: true}, _bin4 = {binop: 4, beforeExpr: true}; + var _bin5 = {binop: 5, beforeExpr: true}, _bin6 = {binop: 6, beforeExpr: true}; + var _bin7 = {binop: 7, beforeExpr: true}, _bin8 = {binop: 8, beforeExpr: true}; + var _bin10 = {binop: 10, beforeExpr: true}; + + // This is a trick taken from Esprima. It turns out that, on + // non-Chrome browsers, to check whether a string is in a set, a + // predicate containing a big ugly `switch` statement is faster than + // a regular expression, and on Chrome the two are about on par. + // This function uses `eval` (non-lexical) to produce such a + // predicate from a space-separated string of words. + // + // It starts by sorting the words by length. + + function makePredicate(words) { + words = words.split(" "); + var f = "", cats = []; + out: for (var i = 0; i < words.length; ++i) { + for (var j = 0; j < cats.length; ++j) + if (cats[j][0].length == words[i].length) { + cats[j].push(words[i]); + continue out; + } + cats.push([words[i]]); + } + function compareTo(arr) { + if (arr.length == 1) return f += "return str === " + JSON.stringify(arr[0]) + ";"; + f += "switch(str){"; + for (var i = 0; i < arr.length; ++i) f += "case " + JSON.stringify(arr[i]) + ":"; + f += "return true}return false;"; + } + + // When there are more than three length categories, an outer + // switch first dispatches on the lengths, to save on comparisons. + + if (cats.length > 3) { + cats.sort(function(a, b) {return b.length - a.length;}); + f += "switch(str.length){"; + for (var i = 0; i < cats.length; ++i) { + var cat = cats[i]; + f += "case " + cat[0].length + ":"; + compareTo(cat); + } + f += "}"; + + // Otherwise, simply generate a flat `switch` statement. + + } else { + compareTo(words); + } + return new Function("str", f); + } + + // The ECMAScript 3 reserved word list. + + var isReservedWord3 = makePredicate("abstract boolean byte char class double enum export extends final float goto implements import int interface long native package private protected public short static super synchronized throws transient volatile"); + + // ECMAScript 5 reserved words. + + var isReservedWord5 = makePredicate("class enum extends super const export import"); + + // The additional reserved words in strict mode. + + var isStrictReservedWord = makePredicate("implements interface let package private protected public static yield"); + + // The forbidden variable names in strict mode. + + var isStrictBadIdWord = makePredicate("eval arguments"); + + // And the keywords. + + var isKeyword = makePredicate("break case catch continue debugger default do else finally for function if return switch throw try var while with null true false instanceof typeof void delete new in this"); + + // ## Character categories + + // Big ugly regular expressions that match characters in the + // whitespace, identifier, and identifier-start categories. These + // are only applied when a character is found to actually have a + // code point above 128. + + var nonASCIIwhitespace = /[\u1680\u180e\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]/; + var nonASCIIidentifierStartChars = "\xaa\xb5\xba\xc0-\xd6\xd8-\xf6\xf8-\u02c1\u02c6-\u02d1\u02e0-\u02e4\u02ec\u02ee\u0370-\u0374\u0376\u0377\u037a-\u037d\u0386\u0388-\u038a\u038c\u038e-\u03a1\u03a3-\u03f5\u03f7-\u0481\u048a-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05d0-\u05ea\u05f0-\u05f2\u0620-\u064a\u066e\u066f\u0671-\u06d3\u06d5\u06e5\u06e6\u06ee\u06ef\u06fa-\u06fc\u06ff\u0710\u0712-\u072f\u074d-\u07a5\u07b1\u07ca-\u07ea\u07f4\u07f5\u07fa\u0800-\u0815\u081a\u0824\u0828\u0840-\u0858\u08a0\u08a2-\u08ac\u0904-\u0939\u093d\u0950\u0958-\u0961\u0971-\u0977\u0979-\u097f\u0985-\u098c\u098f\u0990\u0993-\u09a8\u09aa-\u09b0\u09b2\u09b6-\u09b9\u09bd\u09ce\u09dc\u09dd\u09df-\u09e1\u09f0\u09f1\u0a05-\u0a0a\u0a0f\u0a10\u0a13-\u0a28\u0a2a-\u0a30\u0a32\u0a33\u0a35\u0a36\u0a38\u0a39\u0a59-\u0a5c\u0a5e\u0a72-\u0a74\u0a85-\u0a8d\u0a8f-\u0a91\u0a93-\u0aa8\u0aaa-\u0ab0\u0ab2\u0ab3\u0ab5-\u0ab9\u0abd\u0ad0\u0ae0\u0ae1\u0b05-\u0b0c\u0b0f\u0b10\u0b13-\u0b28\u0b2a-\u0b30\u0b32\u0b33\u0b35-\u0b39\u0b3d\u0b5c\u0b5d\u0b5f-\u0b61\u0b71\u0b83\u0b85-\u0b8a\u0b8e-\u0b90\u0b92-\u0b95\u0b99\u0b9a\u0b9c\u0b9e\u0b9f\u0ba3\u0ba4\u0ba8-\u0baa\u0bae-\u0bb9\u0bd0\u0c05-\u0c0c\u0c0e-\u0c10\u0c12-\u0c28\u0c2a-\u0c33\u0c35-\u0c39\u0c3d\u0c58\u0c59\u0c60\u0c61\u0c85-\u0c8c\u0c8e-\u0c90\u0c92-\u0ca8\u0caa-\u0cb3\u0cb5-\u0cb9\u0cbd\u0cde\u0ce0\u0ce1\u0cf1\u0cf2\u0d05-\u0d0c\u0d0e-\u0d10\u0d12-\u0d3a\u0d3d\u0d4e\u0d60\u0d61\u0d7a-\u0d7f\u0d85-\u0d96\u0d9a-\u0db1\u0db3-\u0dbb\u0dbd\u0dc0-\u0dc6\u0e01-\u0e30\u0e32\u0e33\u0e40-\u0e46\u0e81\u0e82\u0e84\u0e87\u0e88\u0e8a\u0e8d\u0e94-\u0e97\u0e99-\u0e9f\u0ea1-\u0ea3\u0ea5\u0ea7\u0eaa\u0eab\u0ead-\u0eb0\u0eb2\u0eb3\u0ebd\u0ec0-\u0ec4\u0ec6\u0edc-\u0edf\u0f00\u0f40-\u0f47\u0f49-\u0f6c\u0f88-\u0f8c\u1000-\u102a\u103f\u1050-\u1055\u105a-\u105d\u1061\u1065\u1066\u106e-\u1070\u1075-\u1081\u108e\u10a0-\u10c5\u10c7\u10cd\u10d0-\u10fa\u10fc-\u1248\u124a-\u124d\u1250-\u1256\u1258\u125a-\u125d\u1260-\u1288\u128a-\u128d\u1290-\u12b0\u12b2-\u12b5\u12b8-\u12be\u12c0\u12c2-\u12c5\u12c8-\u12d6\u12d8-\u1310\u1312-\u1315\u1318-\u135a\u1380-\u138f\u13a0-\u13f4\u1401-\u166c\u166f-\u167f\u1681-\u169a\u16a0-\u16ea\u16ee-\u16f0\u1700-\u170c\u170e-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176c\u176e-\u1770\u1780-\u17b3\u17d7\u17dc\u1820-\u1877\u1880-\u18a8\u18aa\u18b0-\u18f5\u1900-\u191c\u1950-\u196d\u1970-\u1974\u1980-\u19ab\u19c1-\u19c7\u1a00-\u1a16\u1a20-\u1a54\u1aa7\u1b05-\u1b33\u1b45-\u1b4b\u1b83-\u1ba0\u1bae\u1baf\u1bba-\u1be5\u1c00-\u1c23\u1c4d-\u1c4f\u1c5a-\u1c7d\u1ce9-\u1cec\u1cee-\u1cf1\u1cf5\u1cf6\u1d00-\u1dbf\u1e00-\u1f15\u1f18-\u1f1d\u1f20-\u1f45\u1f48-\u1f4d\u1f50-\u1f57\u1f59\u1f5b\u1f5d\u1f5f-\u1f7d\u1f80-\u1fb4\u1fb6-\u1fbc\u1fbe\u1fc2-\u1fc4\u1fc6-\u1fcc\u1fd0-\u1fd3\u1fd6-\u1fdb\u1fe0-\u1fec\u1ff2-\u1ff4\u1ff6-\u1ffc\u2071\u207f\u2090-\u209c\u2102\u2107\u210a-\u2113\u2115\u2119-\u211d\u2124\u2126\u2128\u212a-\u212d\u212f-\u2139\u213c-\u213f\u2145-\u2149\u214e\u2160-\u2188\u2c00-\u2c2e\u2c30-\u2c5e\u2c60-\u2ce4\u2ceb-\u2cee\u2cf2\u2cf3\u2d00-\u2d25\u2d27\u2d2d\u2d30-\u2d67\u2d6f\u2d80-\u2d96\u2da0-\u2da6\u2da8-\u2dae\u2db0-\u2db6\u2db8-\u2dbe\u2dc0-\u2dc6\u2dc8-\u2dce\u2dd0-\u2dd6\u2dd8-\u2dde\u2e2f\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303c\u3041-\u3096\u309d-\u309f\u30a1-\u30fa\u30fc-\u30ff\u3105-\u312d\u3131-\u318e\u31a0-\u31ba\u31f0-\u31ff\u3400-\u4db5\u4e00-\u9fcc\ua000-\ua48c\ua4d0-\ua4fd\ua500-\ua60c\ua610-\ua61f\ua62a\ua62b\ua640-\ua66e\ua67f-\ua697\ua6a0-\ua6ef\ua717-\ua71f\ua722-\ua788\ua78b-\ua78e\ua790-\ua793\ua7a0-\ua7aa\ua7f8-\ua801\ua803-\ua805\ua807-\ua80a\ua80c-\ua822\ua840-\ua873\ua882-\ua8b3\ua8f2-\ua8f7\ua8fb\ua90a-\ua925\ua930-\ua946\ua960-\ua97c\ua984-\ua9b2\ua9cf\uaa00-\uaa28\uaa40-\uaa42\uaa44-\uaa4b\uaa60-\uaa76\uaa7a\uaa80-\uaaaf\uaab1\uaab5\uaab6\uaab9-\uaabd\uaac0\uaac2\uaadb-\uaadd\uaae0-\uaaea\uaaf2-\uaaf4\uab01-\uab06\uab09-\uab0e\uab11-\uab16\uab20-\uab26\uab28-\uab2e\uabc0-\uabe2\uac00-\ud7a3\ud7b0-\ud7c6\ud7cb-\ud7fb\uf900-\ufa6d\ufa70-\ufad9\ufb00-\ufb06\ufb13-\ufb17\ufb1d\ufb1f-\ufb28\ufb2a-\ufb36\ufb38-\ufb3c\ufb3e\ufb40\ufb41\ufb43\ufb44\ufb46-\ufbb1\ufbd3-\ufd3d\ufd50-\ufd8f\ufd92-\ufdc7\ufdf0-\ufdfb\ufe70-\ufe74\ufe76-\ufefc\uff21-\uff3a\uff41-\uff5a\uff66-\uffbe\uffc2-\uffc7\uffca-\uffcf\uffd2-\uffd7\uffda-\uffdc"; + var nonASCIIidentifierChars = "\u0371-\u0374\u0483-\u0487\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u0620-\u0649\u0672-\u06d3\u06e7-\u06e8\u06fb-\u06fc\u0730-\u074a\u0800-\u0814\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0840-\u0857\u08e4-\u08fe\u0900-\u0903\u093a-\u093c\u093e-\u094f\u0951-\u0957\u0962-\u0963\u0966-\u096f\u0981-\u0983\u09bc\u09be-\u09c4\u09c7\u09c8\u09d7\u09df-\u09e0\u0a01-\u0a03\u0a3c\u0a3e-\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a66-\u0a71\u0a75\u0a81-\u0a83\u0abc\u0abe-\u0ac5\u0ac7-\u0ac9\u0acb-\u0acd\u0ae2-\u0ae3\u0ae6-\u0aef\u0b01-\u0b03\u0b3c\u0b3e-\u0b44\u0b47\u0b48\u0b4b-\u0b4d\u0b56\u0b57\u0b5f-\u0b60\u0b66-\u0b6f\u0b82\u0bbe-\u0bc2\u0bc6-\u0bc8\u0bca-\u0bcd\u0bd7\u0be6-\u0bef\u0c01-\u0c03\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62-\u0c63\u0c66-\u0c6f\u0c82\u0c83\u0cbc\u0cbe-\u0cc4\u0cc6-\u0cc8\u0cca-\u0ccd\u0cd5\u0cd6\u0ce2-\u0ce3\u0ce6-\u0cef\u0d02\u0d03\u0d46-\u0d48\u0d57\u0d62-\u0d63\u0d66-\u0d6f\u0d82\u0d83\u0dca\u0dcf-\u0dd4\u0dd6\u0dd8-\u0ddf\u0df2\u0df3\u0e34-\u0e3a\u0e40-\u0e45\u0e50-\u0e59\u0eb4-\u0eb9\u0ec8-\u0ecd\u0ed0-\u0ed9\u0f18\u0f19\u0f20-\u0f29\u0f35\u0f37\u0f39\u0f41-\u0f47\u0f71-\u0f84\u0f86-\u0f87\u0f8d-\u0f97\u0f99-\u0fbc\u0fc6\u1000-\u1029\u1040-\u1049\u1067-\u106d\u1071-\u1074\u1082-\u108d\u108f-\u109d\u135d-\u135f\u170e-\u1710\u1720-\u1730\u1740-\u1750\u1772\u1773\u1780-\u17b2\u17dd\u17e0-\u17e9\u180b-\u180d\u1810-\u1819\u1920-\u192b\u1930-\u193b\u1951-\u196d\u19b0-\u19c0\u19c8-\u19c9\u19d0-\u19d9\u1a00-\u1a15\u1a20-\u1a53\u1a60-\u1a7c\u1a7f-\u1a89\u1a90-\u1a99\u1b46-\u1b4b\u1b50-\u1b59\u1b6b-\u1b73\u1bb0-\u1bb9\u1be6-\u1bf3\u1c00-\u1c22\u1c40-\u1c49\u1c5b-\u1c7d\u1cd0-\u1cd2\u1d00-\u1dbe\u1e01-\u1f15\u200c\u200d\u203f\u2040\u2054\u20d0-\u20dc\u20e1\u20e5-\u20f0\u2d81-\u2d96\u2de0-\u2dff\u3021-\u3028\u3099\u309a\ua640-\ua66d\ua674-\ua67d\ua69f\ua6f0-\ua6f1\ua7f8-\ua800\ua806\ua80b\ua823-\ua827\ua880-\ua881\ua8b4-\ua8c4\ua8d0-\ua8d9\ua8f3-\ua8f7\ua900-\ua909\ua926-\ua92d\ua930-\ua945\ua980-\ua983\ua9b3-\ua9c0\uaa00-\uaa27\uaa40-\uaa41\uaa4c-\uaa4d\uaa50-\uaa59\uaa7b\uaae0-\uaae9\uaaf2-\uaaf3\uabc0-\uabe1\uabec\uabed\uabf0-\uabf9\ufb20-\ufb28\ufe00-\ufe0f\ufe20-\ufe26\ufe33\ufe34\ufe4d-\ufe4f\uff10-\uff19\uff3f"; + var nonASCIIidentifierStart = new RegExp("[" + nonASCIIidentifierStartChars + "]"); + var nonASCIIidentifier = new RegExp("[" + nonASCIIidentifierStartChars + nonASCIIidentifierChars + "]"); + + // Whether a single character denotes a newline. + + var newline = /[\n\r\u2028\u2029]/; + + // Matches a whole line break (where CRLF is considered a single + // line break). Used to count lines. + + var lineBreak = /\r\n|[\n\r\u2028\u2029]/g; + + // Test whether a given character code starts an identifier. + + function isIdentifierStart(code) { + if (code < 65) return code === 36; + if (code < 91) return true; + if (code < 97) return code === 95; + if (code < 123)return true; + return code >= 0xaa && nonASCIIidentifierStart.test(String.fromCharCode(code)); + } + + // Test whether a given character is part of an identifier. + + function isIdentifierChar(code) { + if (code < 48) return code === 36; + if (code < 58) return true; + if (code < 65) return false; + if (code < 91) return true; + if (code < 97) return code === 95; + if (code < 123)return true; + return code >= 0xaa && nonASCIIidentifier.test(String.fromCharCode(code)); + } + + // ## Tokenizer + + // These are used when `options.locations` is on, in order to track + // the current line number and start of line offset, in order to set + // `tokStartLoc` and `tokEndLoc`. + + function nextLineStart() { + lineBreak.lastIndex = tokLineStart; + var match = lineBreak.exec(input); + return match ? match.index + match[0].length : input.length + 1; + } + + function curLineLoc() { + while (tokLineStartNext <= tokPos) { + ++tokCurLine; + tokLineStart = tokLineStartNext; + tokLineStartNext = nextLineStart(); + } + return {line: tokCurLine, column: tokPos - tokLineStart}; + } + + // Reset the token state. Used at the start of a parse. + + function initTokenState() { + tokCurLine = 1; + tokPos = tokLineStart = 0; + tokLineStartNext = nextLineStart(); + tokRegexpAllowed = true; + tokComments = null; + skipSpace(); + } + + // Called at the end of every token. Sets `tokEnd`, `tokVal`, + // `tokCommentsAfter`, and `tokRegexpAllowed`, and skips the space + // after the token, so that the next one's `tokStart` will point at + // the right position. + + function finishToken(type, val) { + tokEnd = tokPos; + if (options.locations) tokEndLoc = curLineLoc(); + tokType = type; + skipSpace(); + tokVal = val; + tokCommentsAfter = tokComments; + tokRegexpAllowed = type.beforeExpr; + } + + function skipBlockComment() { + var end = input.indexOf("*/", tokPos += 2); + if (end === -1) raise(tokPos - 2, "Unterminated comment"); + if (options.trackComments) + (tokComments || (tokComments = [])).push(input.slice(tokPos, end)); + tokPos = end + 2; + } + + function skipLineComment() { + var start = tokPos; + var ch = input.charCodeAt(tokPos+=2); + while (tokPos < inputLen && ch !== 10 && ch !== 13 && ch !== 8232 && ch !== 8329) { + ++tokPos; + ch = input.charCodeAt(tokPos); + } + (tokComments || (tokComments = [])).push(input.slice(start, tokPos)); + } + + // Called at the start of the parse and after every token. Skips + // whitespace and comments, and, if `options.trackComments` is on, + // will store all skipped comments in `tokComments`. + + function skipSpace() { + tokComments = null; + while (tokPos < inputLen) { + var ch = input.charCodeAt(tokPos); + if (ch === 47) { // '/' + var next = input.charCodeAt(tokPos+1); + if (next === 42) { // '*' + skipBlockComment(); + } else if (next === 47) { // '/' + skipLineComment(); + } else break; + } else if (ch < 14 && ch > 8) { + ++tokPos; + } else if (ch === 32 || ch === 160) { // ' ', '\xa0' + ++tokPos; + } else if (ch >= 5760 && nonASCIIwhitespace.test(String.fromCharCode(ch))) { + ++tokPos; + } else { + break; + } + } + } + + // ### Token reading + + // This is the function that is called to fetch the next token. It + // is somewhat obscure, because it works in character codes rather + // than characters, and because operator parsing has been inlined + // into it. + // + // All in the name of speed. + // + // The `forceRegexp` parameter is used in the one case where the + // `tokRegexpAllowed` trick does not work. See `parseStatement`. + + function readToken(forceRegexp) { + tokStart = tokPos; + if (options.locations) tokStartLoc = curLineLoc(); + tokCommentsBefore = tokComments; + if (forceRegexp) return readRegexp(); + if (tokPos >= inputLen) return finishToken(_eof); + + var code = input.charCodeAt(tokPos); + // Identifier or keyword. '\uXXXX' sequences are allowed in + // identifiers, so '\' also dispatches to that. + if (isIdentifierStart(code) || code === 92 /* '\' */) return readWord(); + var next = input.charCodeAt(tokPos+1); + + switch(code) { + // The interpretation of a dot depends on whether it is followed + // by a digit. + case 46: // '.' + if (next >= 48 && next <= 57) return readNumber(String.fromCharCode(code)); + ++tokPos; + return finishToken(_dot); + + // Punctuation tokens. + case 40: ++tokPos; return finishToken(_parenL); + case 41: ++tokPos; return finishToken(_parenR); + case 59: ++tokPos; return finishToken(_semi); + case 44: ++tokPos; return finishToken(_comma); + case 91: ++tokPos; return finishToken(_bracketL); + case 93: ++tokPos; return finishToken(_bracketR); + case 123: ++tokPos; return finishToken(_braceL); + case 125: ++tokPos; return finishToken(_braceR); + case 58: ++tokPos; return finishToken(_colon); + case 63: ++tokPos; return finishToken(_question); + + // '0x' is a hexadecimal number. + case 48: // '0' + if (next === 120 || next === 88) return readHexNumber(); + // Anything else beginning with a digit is an integer, octal + // number, or float. + case 49: case 50: case 51: case 52: case 53: case 54: case 55: case 56: case 57: // 1-9 + return readNumber(String.fromCharCode(code)); + + // Quotes produce strings. + case 34: case 39: // '"', "'" + return readString(code); + + // Operators are parsed inline in tiny state machines. '=' (61) is + // often referred to. `finishOp` simply skips the amount of + // characters it is given as second argument, and returns a token + // of the type given by its first argument. + + case 47: // '/' + if (tokRegexpAllowed) {++tokPos; return readRegexp();} + if (next === 61) return finishOp(_assign, 2); + return finishOp(_slash, 1); + + case 37: case 42: // '%*' + if (next === 61) return finishOp(_assign, 2); + return finishOp(_bin10, 1); + + case 124: case 38: // '|&' + if (next === code) return finishOp(code === 124 ? _bin1 : _bin2, 2); + if (next === 61) return finishOp(_assign, 2); + return finishOp(code === 124 ? _bin3 : _bin5, 1); + + case 94: // '^' + if (next === 61) return finishOp(_assign, 2); + return finishOp(_bin4, 1); + + case 43: case 45: // '+-' + if (next === code) return finishOp(_incdec, 2); + if (next === 61) return finishOp(_assign, 2); + return finishOp(_plusmin, 1); + + case 60: case 62: // '<>' + var size = 1; + if (next === code) { + size = code === 62 && input.charCodeAt(tokPos+2) === 62 ? 3 : 2; + if (input.charCodeAt(tokPos + size) === 61) return finishOp(_assign, size + 1); + return finishOp(_bin8, size); + } + if (next === 61) + size = input.charCodeAt(tokPos+2) === 61 ? 3 : 2; + return finishOp(_bin7, size); + + case 61: case 33: // '=!' + if (next === 61) return finishOp(_bin6, input.charCodeAt(tokPos+2) === 61 ? 3 : 2); + return finishOp(code === 61 ? _eq : _prefix, 1); + + case 126: // '~' + return finishOp(_prefix, 1); + } + + // If we are here, we either found a non-ASCII identifier + // character, or something that's entirely disallowed. + var ch = String.fromCharCode(code); + if (ch === "\\" || nonASCIIidentifierStart.test(ch)) return readWord(); + raise(tokPos, "Unexpected character '" + ch + "'"); + } + + function finishOp(type, size) { + var str = input.slice(tokPos, tokPos + size); + tokPos += size; + finishToken(type, str); + } + + // Parse a regular expression. Some context-awareness is necessary, + // since a '/' inside a '[]' set does not end the expression. + + function readRegexp() { + var content = "", escaped, inClass, start = tokPos; + for (;;) { + if (tokPos >= inputLen) raise(start, "Unterminated regular expression"); + var ch = input.charAt(tokPos); + if (newline.test(ch)) raise(start, "Unterminated regular expression"); + if (!escaped) { + if (ch === "[") inClass = true; + else if (ch === "]" && inClass) inClass = false; + else if (ch === "/" && !inClass) break; + escaped = ch === "\\"; + } else escaped = false; + ++tokPos; + } + var content = input.slice(start, tokPos); + ++tokPos; + // Need to use `readWord1` because '\uXXXX' sequences are allowed + // here (don't ask). + var mods = readWord1(); + if (mods && !/^[gmsiy]*$/.test(mods)) raise(start, "Invalid regexp flag"); + return finishToken(_regexp, new RegExp(content, mods)); + } + + // Read an integer in the given radix. Return null if zero digits + // were read, the integer value otherwise. When `len` is given, this + // will return `null` unless the integer has exactly `len` digits. + + function readInt(radix, len) { + var start = tokPos, total = 0; + for (;;) { + var code = input.charCodeAt(tokPos), val; + if (code >= 97) val = code - 97 + 10; // a + else if (code >= 65) val = code - 65 + 10; // A + else if (code >= 48 && code <= 57) val = code - 48; // 0-9 + else val = Infinity; + if (val >= radix) break; + ++tokPos; + total = total * radix + val; + } + if (tokPos === start || len != null && tokPos - start !== len) return null; + + return total; + } + + function readHexNumber() { + tokPos += 2; // 0x + var val = readInt(16); + if (val == null) raise(tokStart + 2, "Expected hexadecimal number"); + if (isIdentifierStart(input.charCodeAt(tokPos))) raise(tokPos, "Identifier directly after number"); + return finishToken(_num, val); + } + + // Read an integer, octal integer, or floating-point number. + + function readNumber(ch) { + var start = tokPos, isFloat = ch === "."; + if (!isFloat && readInt(10) == null) raise(start, "Invalid number"); + if (isFloat || input.charAt(tokPos) === ".") { + var next = input.charAt(++tokPos); + if (next === "-" || next === "+") ++tokPos; + if (readInt(10) === null && ch === ".") raise(start, "Invalid number"); + isFloat = true; + } + if (/e/i.test(input.charAt(tokPos))) { + var next = input.charAt(++tokPos); + if (next === "-" || next === "+") ++tokPos; + if (readInt(10) === null) raise(start, "Invalid number") + isFloat = true; + } + if (isIdentifierStart(input.charCodeAt(tokPos))) raise(tokPos, "Identifier directly after number"); + + var str = input.slice(start, tokPos), val; + if (isFloat) val = parseFloat(str); + else if (ch !== "0" || str.length === 1) val = parseInt(str, 10); + else if (/[89]/.test(str) || strict) raise(start, "Invalid number"); + else val = parseInt(str, 8); + return finishToken(_num, val); + } + + // Read a string value, interpreting backslash-escapes. + + function readString(quote) { + tokPos++; + var str = []; + for (;;) { + if (tokPos >= inputLen) raise(tokStart, "Unterminated string constant"); + var ch = input.charCodeAt(tokPos); + if (ch === quote) { + ++tokPos; + return finishToken(_string, String.fromCharCode.apply(null, str)); + } + if (ch === 92) { // '\' + ch = input.charCodeAt(++tokPos); + var octal = /^[0-7]+/.exec(input.slice(tokPos, tokPos + 3)); + if (octal) octal = octal[0]; + while (octal && parseInt(octal, 8) > 255) octal = octal.slice(0, octal.length - 1); + if (octal === "0") octal = null; + ++tokPos; + if (octal) { + if (strict) raise(tokPos - 2, "Octal literal in strict mode"); + str.push(parseInt(octal, 8)); + tokPos += octal.length - 1; + } else { + switch (ch) { + case 110: str.push(10); break; // 'n' -> '\n' + case 114: str.push(13); break; // 'r' -> '\r' + case 120: str.push(readHexChar(2)); break; // 'x' + case 117: str.push(readHexChar(4)); break; // 'u' + case 85: str.push(readHexChar(8)); break; // 'U' + case 116: str.push(9); break; // 't' -> '\t' + case 98: str.push(8); break; // 'b' -> '\b' + case 118: str.push(11); break; // 'v' -> '\u000b' + case 102: str.push(12); break; // 'f' -> '\f' + case 48: str.push(0); break; // 0 -> '\0' + case 13: if (input.charCodeAt(tokPos) === 10) ++tokPos; // '\r\n' + case 10: break; // ' \n' + default: str.push(ch); break; + } + } + } else { + if (ch === 13 || ch === 10 || ch === 8232 || ch === 8329) raise(tokStart, "Unterminated string constant"); + if (ch !== 92) str.push(ch); // '\' + ++tokPos; + } + } + } + + // Used to read character escape sequences ('\x', '\u', '\U'). + + function readHexChar(len) { + var n = readInt(16, len); + if (n === null) raise(tokStart, "Bad character escape sequence"); + return n; + } + + // Used to signal to callers of `readWord1` whether the word + // contained any escape sequences. This is needed because words with + // escape sequences must not be interpreted as keywords. + + var containsEsc; + + // Read an identifier, and return it as a string. Sets `containsEsc` + // to whether the word contained a '\u' escape. + // + // Only builds up the word character-by-character when it actually + // containeds an escape, as a micro-optimization. + + function readWord1() { + containsEsc = false; + var word, first = true, start = tokPos; + for (;;) { + var ch = input.charCodeAt(tokPos); + if (isIdentifierChar(ch)) { + if (containsEsc) word += input.charAt(tokPos); + ++tokPos; + } else if (ch === 92) { // "\" + if (!containsEsc) word = input.slice(start, tokPos); + containsEsc = true; + if (input.charCodeAt(++tokPos) != 117) // "u" + raise(tokPos, "Expecting Unicode escape sequence \\uXXXX"); + ++tokPos; + var esc = readHexChar(4); + var escStr = String.fromCharCode(esc); + if (!escStr) raise(tokPos - 1, "Invalid Unicode escape"); + if (!(first ? isIdentifierStart(esc) : isIdentifierChar(esc))) + raise(tokPos - 4, "Invalid Unicode escape"); + word += escStr; + } else { + break; + } + first = false; + } + return containsEsc ? word : input.slice(start, tokPos); + } + + // Read an identifier or keyword token. Will check for reserved + // words when necessary. + + function readWord() { + var word = readWord1(); + var type = _name; + if (!containsEsc) { + if (isKeyword(word)) type = keywordTypes[word]; + else if (options.forbidReserved && + (options.ecmaVersion === 3 ? isReservedWord3 : isReservedWord5)(word) || + strict && isStrictReservedWord(word)) + raise(tokStart, "The keyword '" + word + "' is reserved"); + } + return finishToken(type, word); + } + + // ## Parser + + // A recursive descent parser operates by defining functions for all + // syntactic elements, and recursively calling those, each function + // advancing the input stream and returning an AST node. Precedence + // of constructs (for example, the fact that `!x[1]` means `!(x[1])` + // instead of `(!x)[1]` is handled by the fact that the parser + // function that parses unary prefix operators is called first, and + // in turn calls the function that parses `[]` subscripts — that + // way, it'll receive the node for `x[1]` already parsed, and wraps + // *that* in the unary operator node. + // + // Acorn uses an [operator precedence parser][opp] to handle binary + // operator precedence, because it is much more compact than using + // the technique outlined above, which uses different, nesting + // functions to specify precedence, for all of the ten binary + // precedence levels that JavaScript defines. + // + // [opp]: http://en.wikipedia.org/wiki/Operator-precedence_parser + + // ### Parser utilities + + // Continue to the next token. + + function next() { + lastStart = tokStart; + lastEnd = tokEnd; + lastEndLoc = tokEndLoc; + readToken(); + } + + // Enter strict mode. Re-reads the next token to please pedantic + // tests ("use strict"; 010; -- should fail). + + function setStrict(strct) { + strict = strct; + tokPos = lastEnd; + skipSpace(); + readToken(); + } + + // Start an AST node, attaching a start offset and optionally a + // `commentsBefore` property to it. + + function startNode() { + var node = {type: null, start: tokStart, end: null}; + if (options.trackComments && tokCommentsBefore) { + node.commentsBefore = tokCommentsBefore; + tokCommentsBefore = null; + } + if (options.locations) + node.loc = {start: tokStartLoc, end: null, source: sourceFile}; + if (options.ranges) + node.range = [tokStart, 0]; + return node; + } + + // Start a node whose start offset/comments information should be + // based on the start of another node. For example, a binary + // operator node is only started after its left-hand side has + // already been parsed. + + function startNodeFrom(other) { + var node = {type: null, start: other.start}; + if (other.commentsBefore) { + node.commentsBefore = other.commentsBefore; + other.commentsBefore = null; + } + if (options.locations) + node.loc = {start: other.loc.start, end: null, source: other.loc.source}; + if (options.ranges) + node.range = [other.range[0], 0]; + + return node; + } + + // Finish an AST node, adding `type`, `end`, and `commentsAfter` + // properties. + // + // We keep track of the last node that we finished, in order + // 'bubble' `commentsAfter` properties up to the biggest node. I.e. + // in '`1 + 1 // foo', the comment should be attached to the binary + // operator node, not the second literal node. + + var lastFinishedNode; + + function finishNode(node, type) { + node.type = type; + node.end = lastEnd; + if (options.trackComments) { + if (tokCommentsAfter) { + node.commentsAfter = tokCommentsAfter; + tokCommentsAfter = null; + } else if (lastFinishedNode && lastFinishedNode.end === lastEnd) { + node.commentsAfter = lastFinishedNode.commentsAfter; + lastFinishedNode.commentsAfter = null; + } + lastFinishedNode = node; + } + if (options.locations) + node.loc.end = lastEndLoc; + if (options.ranges) + node.range[1] = lastEnd; + return node; + } + + // Test whether a statement node is the string literal `"use strict"`. + + function isUseStrict(stmt) { + return options.ecmaVersion >= 5 && stmt.type === "ExpressionStatement" && + stmt.expression.type === "Literal" && stmt.expression.value === "use strict"; + } + + // Predicate that tests whether the next token is of the given + // type, and if yes, consumes it as a side effect. + + function eat(type) { + if (tokType === type) { + next(); + return true; + } + } + + // Test whether a semicolon can be inserted at the current position. + + function canInsertSemicolon() { + return !options.strictSemicolons && + (tokType === _eof || tokType === _braceR || newline.test(input.slice(lastEnd, tokStart))); + } + + // Consume a semicolon, or, failing that, see if we are allowed to + // pretend that there is a semicolon at this position. + + function semicolon() { + if (!eat(_semi) && !canInsertSemicolon()) unexpected(); + } + + // Expect a token of a given type. If found, consume it, otherwise, + // raise an unexpected token error. + + function expect(type) { + if (tokType === type) next(); + else unexpected(); + } + + // Raise an unexpected token error. + + function unexpected() { + raise(tokStart, "Unexpected token"); + } + + // Verify that a node is an lval — something that can be assigned + // to. + + function checkLVal(expr) { + if (expr.type !== "Identifier" && expr.type !== "MemberExpression") + raise(expr.start, "Assigning to rvalue"); + if (strict && expr.type === "Identifier" && isStrictBadIdWord(expr.name)) + raise(expr.start, "Assigning to " + expr.name + " in strict mode"); + } + + // ### Statement parsing + + // Parse a program. Initializes the parser, reads any number of + // statements, and wraps them in a Program node. Optionally takes a + // `program` argument. If present, the statements will be appended + // to its body instead of creating a new node. + + function parseTopLevel(program) { + initTokenState(); + lastStart = lastEnd = tokPos; + if (options.locations) lastEndLoc = curLineLoc(); + inFunction = strict = null; + labels = []; + readToken(); + + var node = program || startNode(), first = true; + if (!program) node.body = []; + while (tokType !== _eof) { + var stmt = parseStatement(); + node.body.push(stmt); + if (first && isUseStrict(stmt)) setStrict(true); + first = false; + } + return finishNode(node, "Program"); + }; + + var loopLabel = {kind: "loop"}, switchLabel = {kind: "switch"}; + + // Parse a single statement. + // + // If expecting a statement and finding a slash operator, parse a + // regular expression literal. This is to handle cases like + // `if (foo) /blah/.exec(foo);`, where looking at the previous token + // does not help. + + function parseStatement() { + if (tokType === _slash) + readToken(true); + + var starttype = tokType, node = startNode(); + + // Most types of statements are recognized by the keyword they + // start with. Many are trivial to parse, some require a bit of + // complexity. + + switch (starttype) { + case _break: case _continue: + next(); + var isBreak = starttype === _break; + if (eat(_semi) || canInsertSemicolon()) node.label = null; + else if (tokType !== _name) unexpected(); + else { + node.label = parseIdent(); + semicolon(); + } + + // Verify that there is an actual destination to break or + // continue to. + for (var i = 0; i < labels.length; ++i) { + var lab = labels[i]; + if (node.label == null || lab.name === node.label.name) { + if (lab.kind != null && (isBreak || lab.kind === "loop")) break; + if (node.label && isBreak) break; + } + } + if (i === labels.length) raise(node.start, "Unsyntactic " + starttype.keyword); + return finishNode(node, isBreak ? "BreakStatement" : "ContinueStatement"); + + case _debugger: + next(); + return finishNode(node, "DebuggerStatement"); + + case _do: + next(); + labels.push(loopLabel); + node.body = parseStatement(); + labels.pop(); + expect(_while); + node.test = parseParenExpression(); + semicolon(); + return finishNode(node, "DoWhileStatement"); + + // Disambiguating between a `for` and a `for`/`in` loop is + // non-trivial. Basically, we have to parse the init `var` + // statement or expression, disallowing the `in` operator (see + // the second parameter to `parseExpression`), and then check + // whether the next token is `in`. When there is no init part + // (semicolon immediately after the opening parenthesis), it is + // a regular `for` loop. + + case _for: + next(); + labels.push(loopLabel); + expect(_parenL); + if (tokType === _semi) return parseFor(node, null); + if (tokType === _var) { + var init = startNode(); + next(); + parseVar(init, true); + if (init.declarations.length === 1 && eat(_in)) + return parseForIn(node, init); + return parseFor(node, init); + } + var init = parseExpression(false, true); + if (eat(_in)) {checkLVal(init); return parseForIn(node, init);} + return parseFor(node, init); + + case _function: + next(); + return parseFunction(node, true); + + case _if: + next(); + node.test = parseParenExpression(); + node.consequent = parseStatement(); + node.alternate = eat(_else) ? parseStatement() : null; + return finishNode(node, "IfStatement"); + + case _return: + if (!inFunction) raise(tokStart, "'return' outside of function"); + next(); + + // In `return` (and `break`/`continue`), the keywords with + // optional arguments, we eagerly look for a semicolon or the + // possibility to insert one. + + if (eat(_semi) || canInsertSemicolon()) node.argument = null; + else { node.argument = parseExpression(); semicolon(); } + return finishNode(node, "ReturnStatement"); + + case _switch: + next(); + node.discriminant = parseParenExpression(); + node.cases = []; + expect(_braceL); + labels.push(switchLabel); + + // Statements under must be grouped (by label) in SwitchCase + // nodes. `cur` is used to keep the node that we are currently + // adding statements to. + + for (var cur, sawDefault; tokType != _braceR;) { + if (tokType === _case || tokType === _default) { + var isCase = tokType === _case; + if (cur) finishNode(cur, "SwitchCase"); + node.cases.push(cur = startNode()); + cur.consequent = []; + next(); + if (isCase) cur.test = parseExpression(); + else { + if (sawDefault) raise(lastStart, "Multiple default clauses"); sawDefault = true; + cur.test = null; + } + expect(_colon); + } else { + if (!cur) unexpected(); + cur.consequent.push(parseStatement()); + } + } + if (cur) finishNode(cur, "SwitchCase"); + next(); // Closing brace + labels.pop(); + return finishNode(node, "SwitchStatement"); + + case _throw: + next(); + if (newline.test(input.slice(lastEnd, tokStart))) + raise(lastEnd, "Illegal newline after throw"); + node.argument = parseExpression(); + return finishNode(node, "ThrowStatement"); + + case _try: + next(); + node.block = parseBlock(); + node.handlers = []; + while (tokType === _catch) { + var clause = startNode(); + next(); + expect(_parenL); + clause.param = parseIdent(); + if (strict && isStrictBadIdWord(clause.param.name)) + raise(clause.param.start, "Binding " + clause.param.name + " in strict mode"); + expect(_parenR); + clause.guard = null; + clause.body = parseBlock(); + node.handlers.push(finishNode(clause, "CatchClause")); + } + node.finalizer = eat(_finally) ? parseBlock() : null; + if (!node.handlers.length && !node.finalizer) + raise(node.start, "Missing catch or finally clause"); + return finishNode(node, "TryStatement"); + + case _var: + next(); + node = parseVar(node); + semicolon(); + return node; + + case _while: + next(); + node.test = parseParenExpression(); + labels.push(loopLabel); + node.body = parseStatement(); + labels.pop(); + return finishNode(node, "WhileStatement"); + + case _with: + if (strict) raise(tokStart, "'with' in strict mode"); + next(); + node.object = parseParenExpression(); + node.body = parseStatement(); + return finishNode(node, "WithStatement"); + + case _braceL: + return parseBlock(); + + case _semi: + next(); + return finishNode(node, "EmptyStatement"); + + // If the statement does not start with a statement keyword or a + // brace, it's an ExpressionStatement or LabeledStatement. We + // simply start parsing an expression, and afterwards, if the + // next token is a colon and the expression was a simple + // Identifier node, we switch to interpreting it as a label. + + default: + var maybeName = tokVal, expr = parseExpression(); + if (starttype === _name && expr.type === "Identifier" && eat(_colon)) { + for (var i = 0; i < labels.length; ++i) + if (labels[i].name === maybeName) raise(expr.start, "Label '" + maybeName + "' is already declared"); + var kind = tokType.isLoop ? "loop" : tokType === _switch ? "switch" : null; + labels.push({name: maybeName, kind: kind}); + node.body = parseStatement(); + node.label = expr; + return finishNode(node, "LabeledStatement"); + } else { + node.expression = expr; + semicolon(); + return finishNode(node, "ExpressionStatement"); + } + } + } + + // Used for constructs like `switch` and `if` that insist on + // parentheses around their expression. + + function parseParenExpression() { + expect(_parenL); + var val = parseExpression(); + expect(_parenR); + return val; + } + + // Parse a semicolon-enclosed block of statements, handling `"use + // strict"` declarations when `allowStrict` is true (used for + // function bodies). + + function parseBlock(allowStrict) { + var node = startNode(), first = true, strict = false, oldStrict; + node.body = []; + expect(_braceL); + while (!eat(_braceR)) { + var stmt = parseStatement(); + node.body.push(stmt); + if (first && isUseStrict(stmt)) { + oldStrict = strict; + setStrict(strict = true); + } + first = false + } + if (strict && !oldStrict) setStrict(false); + return finishNode(node, "BlockStatement"); + } + + // Parse a regular `for` loop. The disambiguation code in + // `parseStatement` will already have parsed the init statement or + // expression. + + function parseFor(node, init) { + node.init = init; + expect(_semi); + node.test = tokType === _semi ? null : parseExpression(); + expect(_semi); + node.update = tokType === _parenR ? null : parseExpression(); + expect(_parenR); + node.body = parseStatement(); + labels.pop(); + return finishNode(node, "ForStatement"); + } + + // Parse a `for`/`in` loop. + + function parseForIn(node, init) { + node.left = init; + node.right = parseExpression(); + expect(_parenR); + node.body = parseStatement(); + labels.pop(); + return finishNode(node, "ForInStatement"); + } + + // Parse a list of variable declarations. + + function parseVar(node, noIn) { + node.declarations = []; + node.kind = "var"; + for (;;) { + var decl = startNode(); + decl.id = parseIdent(); + if (strict && isStrictBadIdWord(decl.id.name)) + raise(decl.id.start, "Binding " + decl.id.name + " in strict mode"); + decl.init = eat(_eq) ? parseExpression(true, noIn) : null; + node.declarations.push(finishNode(decl, "VariableDeclarator")); + if (!eat(_comma)) break; + } + return finishNode(node, "VariableDeclaration"); + } + + // ### Expression parsing + + // These nest, from the most general expression type at the top to + // 'atomic', nondivisible expression types at the bottom. Most of + // the functions will simply let the function(s) below them parse, + // and, *if* the syntactic construct they handle is present, wrap + // the AST node that the inner parser gave them in another node. + + // Parse a full expression. The arguments are used to forbid comma + // sequences (in argument lists, array literals, or object literals) + // or the `in` operator (in for loops initalization expressions). + + function parseExpression(noComma, noIn) { + var expr = parseMaybeAssign(noIn); + if (!noComma && tokType === _comma) { + var node = startNodeFrom(expr); + node.expressions = [expr]; + while (eat(_comma)) node.expressions.push(parseMaybeAssign(noIn)); + return finishNode(node, "SequenceExpression"); + } + return expr; + } + + // Parse an assignment expression. This includes applications of + // operators like `+=`. + + function parseMaybeAssign(noIn) { + var left = parseMaybeConditional(noIn); + if (tokType.isAssign) { + var node = startNodeFrom(left); + node.operator = tokVal; + node.left = left; + next(); + node.right = parseMaybeAssign(noIn); + checkLVal(left); + return finishNode(node, "AssignmentExpression"); + } + return left; + } + + // Parse a ternary conditional (`?:`) operator. + + function parseMaybeConditional(noIn) { + var expr = parseExprOps(noIn); + if (eat(_question)) { + var node = startNodeFrom(expr); + node.test = expr; + node.consequent = parseExpression(true); + expect(_colon); + node.alternate = parseExpression(true, noIn); + return finishNode(node, "ConditionalExpression"); + } + return expr; + } + + // Start the precedence parser. + + function parseExprOps(noIn) { + return parseExprOp(parseMaybeUnary(noIn), -1, noIn); + } + + // Parse binary operators with the operator precedence parsing + // algorithm. `left` is the left-hand side of the operator. + // `minPrec` provides context that allows the function to stop and + // defer further parser to one of its callers when it encounters an + // operator that has a lower precedence than the set it is parsing. + + function parseExprOp(left, minPrec, noIn) { + var prec = tokType.binop; + if (prec != null && (!noIn || tokType !== _in)) { + if (prec > minPrec) { + var node = startNodeFrom(left); + node.left = left; + node.operator = tokVal; + next(); + node.right = parseExprOp(parseMaybeUnary(noIn), prec, noIn); + var node = finishNode(node, /&&|\|\|/.test(node.operator) ? "LogicalExpression" : "BinaryExpression"); + return parseExprOp(node, minPrec, noIn); + } + } + return left; + } + + // Parse unary operators, both prefix and postfix. + + function parseMaybeUnary(noIn) { + if (tokType.prefix) { + var node = startNode(), update = tokType.isUpdate; + node.operator = tokVal; + node.prefix = true; + next(); + node.argument = parseMaybeUnary(noIn); + if (update) checkLVal(node.argument); + else if (strict && node.operator === "delete" && + node.argument.type === "Identifier") + raise(node.start, "Deleting local variable in strict mode"); + return finishNode(node, update ? "UpdateExpression" : "UnaryExpression"); + } + var expr = parseExprSubscripts(); + while (tokType.postfix && !canInsertSemicolon()) { + var node = startNodeFrom(expr); + node.operator = tokVal; + node.prefix = false; + node.argument = expr; + checkLVal(expr); + next(); + expr = finishNode(node, "UpdateExpression"); + } + return expr; + } + + // Parse call, dot, and `[]`-subscript expressions. + + function parseExprSubscripts() { + return parseSubscripts(parseExprAtom()); + } + + function parseSubscripts(base, noCalls) { + if (eat(_dot)) { + var node = startNodeFrom(base); + node.object = base; + node.property = parseIdent(true); + node.computed = false; + return parseSubscripts(finishNode(node, "MemberExpression"), noCalls); + } else if (eat(_bracketL)) { + var node = startNodeFrom(base); + node.object = base; + node.property = parseExpression(); + node.computed = true; + expect(_bracketR); + return parseSubscripts(finishNode(node, "MemberExpression"), noCalls); + } else if (!noCalls && eat(_parenL)) { + var node = startNodeFrom(base); + node.callee = base; + node.arguments = parseExprList(_parenR, false); + return parseSubscripts(finishNode(node, "CallExpression"), noCalls); + } else return base; + } + + // Parse an atomic expression — either a single token that is an + // expression, an expression started by a keyword like `function` or + // `new`, or an expression wrapped in punctuation like `()`, `[]`, + // or `{}`. + + function parseExprAtom() { + switch (tokType) { + case _this: + var node = startNode(); + next(); + return finishNode(node, "ThisExpression"); + case _name: + return parseIdent(); + case _num: case _string: case _regexp: + var node = startNode(); + node.value = tokVal; + node.raw = input.slice(tokStart, tokEnd); + next(); + return finishNode(node, "Literal"); + + case _null: case _true: case _false: + var node = startNode(); + node.value = tokType.atomValue; + next(); + return finishNode(node, "Literal"); + + case _parenL: + next(); + var val = parseExpression(); + expect(_parenR); + return val; + + case _bracketL: + var node = startNode(); + next(); + node.elements = parseExprList(_bracketR, true, true); + return finishNode(node, "ArrayExpression"); + + case _braceL: + return parseObj(); + + case _function: + var node = startNode(); + next(); + return parseFunction(node, false); + + case _new: + return parseNew(); + + default: + unexpected(); + } + } + + // New's precedence is slightly tricky. It must allow its argument + // to be a `[]` or dot subscript expression, but not a call — at + // least, not without wrapping it in parentheses. Thus, it uses the + + function parseNew() { + var node = startNode(); + next(); + node.callee = parseSubscripts(parseExprAtom(false), true); + if (eat(_parenL)) node.arguments = parseExprList(_parenR, false); + else node.arguments = []; + return finishNode(node, "NewExpression"); + } + + // Parse an object literal. + + function parseObj() { + var node = startNode(), first = true, sawGetSet = false; + node.properties = []; + next(); + while (!eat(_braceR)) { + if (!first) { + expect(_comma); + if (options.allowTrailingCommas && eat(_braceR)) break; + } else first = false; + + var prop = {key: parsePropertyName()}, isGetSet = false, kind; + if (eat(_colon)) { + prop.value = parseExpression(true); + kind = prop.kind = "init"; + } else if (options.ecmaVersion >= 5 && prop.key.type === "Identifier" && + (prop.key.name === "get" || prop.key.name === "set")) { + isGetSet = sawGetSet = true; + kind = prop.kind = prop.key.name; + prop.key = parsePropertyName(); + if (!tokType === _parenL) unexpected(); + prop.value = parseFunction(startNode(), false); + } else unexpected(); + + // getters and setters are not allowed to clash — either with + // each other or with an init property — and in strict mode, + // init properties are also not allowed to be repeated. + + if (prop.key.type === "Identifier" && (strict || sawGetSet)) { + for (var i = 0; i < node.properties.length; ++i) { + var other = node.properties[i]; + if (other.key.name === prop.key.name) { + var conflict = kind == other.kind || isGetSet && other.kind === "init" || + kind === "init" && (other.kind === "get" || other.kind === "set"); + if (conflict && !strict && kind === "init" && other.kind === "init") conflict = false; + if (conflict) raise(prop.key.start, "Redefinition of property"); + } + } + } + node.properties.push(prop); + } + return finishNode(node, "ObjectExpression"); + } + + function parsePropertyName() { + if (tokType === _num || tokType === _string) return parseExprAtom(); + return parseIdent(true); + } + + // Parse a function declaration or literal (depending on the + // `isStatement` parameter). + + function parseFunction(node, isStatement) { + if (tokType === _name) node.id = parseIdent(); + else if (isStatement) unexpected(); + else node.id = null; + node.params = []; + var first = true; + expect(_parenL); + while (!eat(_parenR)) { + if (!first) expect(_comma); else first = false; + node.params.push(parseIdent()); + } + + // Start a new scope with regard to labels and the `inFunction` + // flag (restore them to their old value afterwards). + var oldInFunc = inFunction, oldLabels = labels; + inFunction = true; labels = []; + node.body = parseBlock(true); + inFunction = oldInFunc; labels = oldLabels; + + // If this is a strict mode function, verify that argument names + // are not repeated, and it does not try to bind the words `eval` + // or `arguments`. + if (strict || node.body.body.length && isUseStrict(node.body.body[0])) { + for (var i = node.id ? -1 : 0; i < node.params.length; ++i) { + var id = i < 0 ? node.id : node.params[i]; + if (isStrictReservedWord(id.name) || isStrictBadIdWord(id.name)) + raise(id.start, "Defining '" + id.name + "' in strict mode"); + if (i >= 0) for (var j = 0; j < i; ++j) if (id.name === node.params[j].name) + raise(id.start, "Argument name clash in strict mode"); + } + } + + return finishNode(node, isStatement ? "FunctionDeclaration" : "FunctionExpression"); + } + + // Parses a comma-separated list of expressions, and returns them as + // an array. `close` is the token type that ends the list, and + // `allowEmpty` can be turned on to allow subsequent commas with + // nothing in between them to be parsed as `null` (which is needed + // for array literals). + + function parseExprList(close, allowTrailingComma, allowEmpty) { + var elts = [], first = true; + while (!eat(close)) { + if (!first) { + expect(_comma); + if (allowTrailingComma && options.allowTrailingCommas && eat(close)) break; + } else first = false; + + if (allowEmpty && tokType === _comma) elts.push(null); + else elts.push(parseExpression(true)); + } + return elts; + } + + // Parse the next token as an identifier. If `liberal` is true (used + // when parsing properties), it will also convert keywords into + // identifiers. + + function parseIdent(liberal) { + var node = startNode(); + node.name = tokType === _name ? tokVal : (liberal && !options.forbidReserved && tokType.keyword) || unexpected(); + next(); + return finishNode(node, "Identifier"); + } + +})(typeof exports === "undefined" ? (window.acorn = {}) : exports); diff --git a/MixERP.Net.FrontEnd/Scripts/CodeMirror/test/lint/lint.js b/MixERP.Net.FrontEnd/Scripts/CodeMirror/test/lint/lint.js new file mode 100644 index 000000000..4fc577fa0 --- /dev/null +++ b/MixERP.Net.FrontEnd/Scripts/CodeMirror/test/lint/lint.js @@ -0,0 +1,112 @@ +/* + Simple linter, based on the Acorn [1] parser module + + All of the existing linters either cramp my style or have huge + dependencies (Closure). So here's a very simple, non-invasive one + that only spots + + - missing semicolons and trailing commas + - variables or properties that are reserved words + - assigning to a variable you didn't declare + + [1]: https://github.com/marijnh/acorn/ +*/ + +var fs = require("fs"), acorn = require("./acorn.js"), walk = require("./walk.js"); + +var scopePasser = walk.make({ + ScopeBody: function(node, prev, c) { c(node, node.scope); } +}); + +function checkFile(fileName) { + var file = fs.readFileSync(fileName, "utf8"), notAllowed; + if (notAllowed = file.match(/[\x00-\x08\x0b\x0c\x0e-\x19\uFEFF\t]|[ \t]\n/)) { + var msg; + if (notAllowed[0] == "\t") msg = "Found tab character"; + else if (notAllowed[0].indexOf("\n") > -1) msg = "Trailing whitespace"; + else msg = "Undesirable character " + notAllowed[0].charCodeAt(0); + var info = acorn.getLineInfo(file, notAllowed.index); + fail(msg + " at line " + info.line + ", column " + info.column, {source: fileName}); + } + + try { + var parsed = acorn.parse(file, { + locations: true, + ecmaVersion: 3, + strictSemicolons: true, + allowTrailingCommas: false, + forbidReserved: true, + sourceFile: fileName + }); + } catch (e) { + fail(e.message, {source: fileName}); + return; + } + + var scopes = []; + + walk.simple(parsed, { + ScopeBody: function(node, scope) { + node.scope = scope; + scopes.push(scope); + } + }, walk.scopeVisitor, {vars: Object.create(null)}); + + var ignoredGlobals = Object.create(null); + + function inScope(name, scope) { + for (var cur = scope; cur; cur = cur.prev) + if (name in cur.vars) return true; + } + function checkLHS(node, scope) { + if (node.type == "Identifier" && !(node.name in ignoredGlobals) && + !inScope(node.name, scope)) { + ignoredGlobals[node.name] = true; + fail("Assignment to global variable", node.loc); + } + } + + walk.simple(parsed, { + UpdateExpression: function(node, scope) {checkLHS(node.argument, scope);}, + AssignmentExpression: function(node, scope) {checkLHS(node.left, scope);}, + Identifier: function(node, scope) { + // Mark used identifiers + for (var cur = scope; cur; cur = cur.prev) + if (node.name in cur.vars) { + cur.vars[node.name].used = true; + return; + } + }, + FunctionExpression: function(node) { + if (node.id) fail("Named function expression", node.loc); + } + }, scopePasser); + + for (var i = 0; i < scopes.length; ++i) { + var scope = scopes[i]; + for (var name in scope.vars) { + var info = scope.vars[name]; + if (!info.used && info.type != "catch clause" && info.type != "function name" && name.charAt(0) != "_") + fail("Unused " + info.type + " " + name, info.node.loc); + } + } +} + +var failed = false; +function fail(msg, pos) { + if (pos.start) msg += " (" + pos.start.line + ":" + pos.start.column + ")"; + console.log(pos.source + ": " + msg); + failed = true; +} + +function checkDir(dir) { + fs.readdirSync(dir).forEach(function(file) { + var fname = dir + "/" + file; + if (/\.js$/.test(file)) checkFile(fname); + else if (file != "dep" && fs.lstatSync(fname).isDirectory()) checkDir(fname); + }); +} + +exports.checkDir = checkDir; +exports.checkFile = checkFile; +exports.success = function() { return !failed; }; diff --git a/MixERP.Net.FrontEnd/Scripts/CodeMirror/test/lint/parse-js.js b/MixERP.Net.FrontEnd/Scripts/CodeMirror/test/lint/parse-js.js new file mode 100644 index 000000000..abd4b942e --- /dev/null +++ b/MixERP.Net.FrontEnd/Scripts/CodeMirror/test/lint/parse-js.js @@ -0,0 +1,1313 @@ +/* -----[ Tokenizer (constants) ]----- */ + +var KEYWORDS = array_to_hash([ + "break", + "case", + "catch", + "const", + "continue", + "debugger", + "default", + "delete", + "do", + "else", + "finally", + "for", + "function", + "if", + "in", + "instanceof", + "new", + "return", + "switch", + "throw", + "try", + "typeof", + "var", + "void", + "while", + "with" +]); + +var RESERVED_WORDS = array_to_hash([ + "abstract", + "boolean", + "byte", + "char", + "class", + "double", + "enum", + "export", + "extends", + "final", + "float", + "goto", + "implements", + "import", + "int", + "interface", + "long", + "native", + "package", + "private", + "protected", + "public", + "short", + "static", + "super", + "synchronized", + "throws", + "transient", + "volatile" +]); + +var KEYWORDS_BEFORE_EXPRESSION = array_to_hash([ + "return", + "new", + "delete", + "throw", + "else", + "case" +]); + +var KEYWORDS_ATOM = array_to_hash([ + "false", + "null", + "true", + "undefined" +]); + +var OPERATOR_CHARS = array_to_hash(characters("+-*&%=<>!?|~^")); + +var RE_HEX_NUMBER = /^0x[0-9a-f]+$/i; +var RE_OCT_NUMBER = /^0[0-7]+$/; +var RE_DEC_NUMBER = /^\d*\.?\d*(?:e[+-]?\d*(?:\d\.?|\.?\d)\d*)?$/i; + +var OPERATORS = array_to_hash([ + "in", + "instanceof", + "typeof", + "new", + "void", + "delete", + "++", + "--", + "+", + "-", + "!", + "~", + "&", + "|", + "^", + "*", + "/", + "%", + ">>", + "<<", + ">>>", + "<", + ">", + "<=", + ">=", + "==", + "===", + "!=", + "!==", + "?", + "=", + "+=", + "-=", + "/=", + "*=", + "%=", + ">>=", + "<<=", + ">>>=", + "|=", + "^=", + "&=", + "&&", + "||" +]); + +var WHITESPACE_CHARS = array_to_hash(characters(" \u00a0\n\r\t\f\u000b\u200b\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000")); + +var PUNC_BEFORE_EXPRESSION = array_to_hash(characters("[{(,.;:")); + +var PUNC_CHARS = array_to_hash(characters("[]{}(),;:")); + +var REGEXP_MODIFIERS = array_to_hash(characters("gmsiy")); + +/* -----[ Tokenizer ]----- */ + +var UNICODE = { // Unicode 6.1 + letter: new RegExp("[\\u0041-\\u005A\\u0061-\\u007A\\u00AA\\u00B5\\u00BA\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02C1\\u02C6-\\u02D1\\u02E0-\\u02E4\\u02EC\\u02EE\\u0370-\\u0374\\u0376\\u0377\\u037A-\\u037D\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03F5\\u03F7-\\u0481\\u048A-\\u0527\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u05D0-\\u05EA\\u05F0-\\u05F2\\u0620-\\u064A\\u066E\\u066F\\u0671-\\u06D3\\u06D5\\u06E5\\u06E6\\u06EE\\u06EF\\u06FA-\\u06FC\\u06FF\\u0710\\u0712-\\u072F\\u074D-\\u07A5\\u07B1\\u07CA-\\u07EA\\u07F4\\u07F5\\u07FA\\u0800-\\u0815\\u081A\\u0824\\u0828\\u0840-\\u0858\\u08A0\\u08A2-\\u08AC\\u0904-\\u0939\\u093D\\u0950\\u0958-\\u0961\\u0971-\\u0977\\u0979-\\u097F\\u0985-\\u098C\\u098F\\u0990\\u0993-\\u09A8\\u09AA-\\u09B0\\u09B2\\u09B6-\\u09B9\\u09BD\\u09CE\\u09DC\\u09DD\\u09DF-\\u09E1\\u09F0\\u09F1\\u0A05-\\u0A0A\\u0A0F\\u0A10\\u0A13-\\u0A28\\u0A2A-\\u0A30\\u0A32\\u0A33\\u0A35\\u0A36\\u0A38\\u0A39\\u0A59-\\u0A5C\\u0A5E\\u0A72-\\u0A74\\u0A85-\\u0A8D\\u0A8F-\\u0A91\\u0A93-\\u0AA8\\u0AAA-\\u0AB0\\u0AB2\\u0AB3\\u0AB5-\\u0AB9\\u0ABD\\u0AD0\\u0AE0\\u0AE1\\u0B05-\\u0B0C\\u0B0F\\u0B10\\u0B13-\\u0B28\\u0B2A-\\u0B30\\u0B32\\u0B33\\u0B35-\\u0B39\\u0B3D\\u0B5C\\u0B5D\\u0B5F-\\u0B61\\u0B71\\u0B83\\u0B85-\\u0B8A\\u0B8E-\\u0B90\\u0B92-\\u0B95\\u0B99\\u0B9A\\u0B9C\\u0B9E\\u0B9F\\u0BA3\\u0BA4\\u0BA8-\\u0BAA\\u0BAE-\\u0BB9\\u0BD0\\u0C05-\\u0C0C\\u0C0E-\\u0C10\\u0C12-\\u0C28\\u0C2A-\\u0C33\\u0C35-\\u0C39\\u0C3D\\u0C58\\u0C59\\u0C60\\u0C61\\u0C85-\\u0C8C\\u0C8E-\\u0C90\\u0C92-\\u0CA8\\u0CAA-\\u0CB3\\u0CB5-\\u0CB9\\u0CBD\\u0CDE\\u0CE0\\u0CE1\\u0CF1\\u0CF2\\u0D05-\\u0D0C\\u0D0E-\\u0D10\\u0D12-\\u0D3A\\u0D3D\\u0D4E\\u0D60\\u0D61\\u0D7A-\\u0D7F\\u0D85-\\u0D96\\u0D9A-\\u0DB1\\u0DB3-\\u0DBB\\u0DBD\\u0DC0-\\u0DC6\\u0E01-\\u0E30\\u0E32\\u0E33\\u0E40-\\u0E46\\u0E81\\u0E82\\u0E84\\u0E87\\u0E88\\u0E8A\\u0E8D\\u0E94-\\u0E97\\u0E99-\\u0E9F\\u0EA1-\\u0EA3\\u0EA5\\u0EA7\\u0EAA\\u0EAB\\u0EAD-\\u0EB0\\u0EB2\\u0EB3\\u0EBD\\u0EC0-\\u0EC4\\u0EC6\\u0EDC-\\u0EDF\\u0F00\\u0F40-\\u0F47\\u0F49-\\u0F6C\\u0F88-\\u0F8C\\u1000-\\u102A\\u103F\\u1050-\\u1055\\u105A-\\u105D\\u1061\\u1065\\u1066\\u106E-\\u1070\\u1075-\\u1081\\u108E\\u10A0-\\u10C5\\u10C7\\u10CD\\u10D0-\\u10FA\\u10FC-\\u1248\\u124A-\\u124D\\u1250-\\u1256\\u1258\\u125A-\\u125D\\u1260-\\u1288\\u128A-\\u128D\\u1290-\\u12B0\\u12B2-\\u12B5\\u12B8-\\u12BE\\u12C0\\u12C2-\\u12C5\\u12C8-\\u12D6\\u12D8-\\u1310\\u1312-\\u1315\\u1318-\\u135A\\u1380-\\u138F\\u13A0-\\u13F4\\u1401-\\u166C\\u166F-\\u167F\\u1681-\\u169A\\u16A0-\\u16EA\\u16EE-\\u16F0\\u1700-\\u170C\\u170E-\\u1711\\u1720-\\u1731\\u1740-\\u1751\\u1760-\\u176C\\u176E-\\u1770\\u1780-\\u17B3\\u17D7\\u17DC\\u1820-\\u1877\\u1880-\\u18A8\\u18AA\\u18B0-\\u18F5\\u1900-\\u191C\\u1950-\\u196D\\u1970-\\u1974\\u1980-\\u19AB\\u19C1-\\u19C7\\u1A00-\\u1A16\\u1A20-\\u1A54\\u1AA7\\u1B05-\\u1B33\\u1B45-\\u1B4B\\u1B83-\\u1BA0\\u1BAE\\u1BAF\\u1BBA-\\u1BE5\\u1C00-\\u1C23\\u1C4D-\\u1C4F\\u1C5A-\\u1C7D\\u1CE9-\\u1CEC\\u1CEE-\\u1CF1\\u1CF5\\u1CF6\\u1D00-\\u1DBF\\u1E00-\\u1F15\\u1F18-\\u1F1D\\u1F20-\\u1F45\\u1F48-\\u1F4D\\u1F50-\\u1F57\\u1F59\\u1F5B\\u1F5D\\u1F5F-\\u1F7D\\u1F80-\\u1FB4\\u1FB6-\\u1FBC\\u1FBE\\u1FC2-\\u1FC4\\u1FC6-\\u1FCC\\u1FD0-\\u1FD3\\u1FD6-\\u1FDB\\u1FE0-\\u1FEC\\u1FF2-\\u1FF4\\u1FF6-\\u1FFC\\u2071\\u207F\\u2090-\\u209C\\u2102\\u2107\\u210A-\\u2113\\u2115\\u2119-\\u211D\\u2124\\u2126\\u2128\\u212A-\\u212D\\u212F-\\u2139\\u213C-\\u213F\\u2145-\\u2149\\u214E\\u2160-\\u2188\\u2C00-\\u2C2E\\u2C30-\\u2C5E\\u2C60-\\u2CE4\\u2CEB-\\u2CEE\\u2CF2\\u2CF3\\u2D00-\\u2D25\\u2D27\\u2D2D\\u2D30-\\u2D67\\u2D6F\\u2D80-\\u2D96\\u2DA0-\\u2DA6\\u2DA8-\\u2DAE\\u2DB0-\\u2DB6\\u2DB8-\\u2DBE\\u2DC0-\\u2DC6\\u2DC8-\\u2DCE\\u2DD0-\\u2DD6\\u2DD8-\\u2DDE\\u2E2F\\u3005-\\u3007\\u3021-\\u3029\\u3031-\\u3035\\u3038-\\u303C\\u3041-\\u3096\\u309D-\\u309F\\u30A1-\\u30FA\\u30FC-\\u30FF\\u3105-\\u312D\\u3131-\\u318E\\u31A0-\\u31BA\\u31F0-\\u31FF\\u3400-\\u4DB5\\u4E00-\\u9FCC\\uA000-\\uA48C\\uA4D0-\\uA4FD\\uA500-\\uA60C\\uA610-\\uA61F\\uA62A\\uA62B\\uA640-\\uA66E\\uA67F-\\uA697\\uA6A0-\\uA6EF\\uA717-\\uA71F\\uA722-\\uA788\\uA78B-\\uA78E\\uA790-\\uA793\\uA7A0-\\uA7AA\\uA7F8-\\uA801\\uA803-\\uA805\\uA807-\\uA80A\\uA80C-\\uA822\\uA840-\\uA873\\uA882-\\uA8B3\\uA8F2-\\uA8F7\\uA8FB\\uA90A-\\uA925\\uA930-\\uA946\\uA960-\\uA97C\\uA984-\\uA9B2\\uA9CF\\uAA00-\\uAA28\\uAA40-\\uAA42\\uAA44-\\uAA4B\\uAA60-\\uAA76\\uAA7A\\uAA80-\\uAAAF\\uAAB1\\uAAB5\\uAAB6\\uAAB9-\\uAABD\\uAAC0\\uAAC2\\uAADB-\\uAADD\\uAAE0-\\uAAEA\\uAAF2-\\uAAF4\\uAB01-\\uAB06\\uAB09-\\uAB0E\\uAB11-\\uAB16\\uAB20-\\uAB26\\uAB28-\\uAB2E\\uABC0-\\uABE2\\uAC00-\\uD7A3\\uD7B0-\\uD7C6\\uD7CB-\\uD7FB\\uF900-\\uFA6D\\uFA70-\\uFAD9\\uFB00-\\uFB06\\uFB13-\\uFB17\\uFB1D\\uFB1F-\\uFB28\\uFB2A-\\uFB36\\uFB38-\\uFB3C\\uFB3E\\uFB40\\uFB41\\uFB43\\uFB44\\uFB46-\\uFBB1\\uFBD3-\\uFD3D\\uFD50-\\uFD8F\\uFD92-\\uFDC7\\uFDF0-\\uFDFB\\uFE70-\\uFE74\\uFE76-\\uFEFC\\uFF21-\\uFF3A\\uFF41-\\uFF5A\\uFF66-\\uFFBE\\uFFC2-\\uFFC7\\uFFCA-\\uFFCF\\uFFD2-\\uFFD7\\uFFDA-\\uFFDC]"), + combining_mark: new RegExp("[\\u0300-\\u036F\\u0483-\\u0487\\u0591-\\u05BD\\u05BF\\u05C1\\u05C2\\u05C4\\u05C5\\u05C7\\u0610-\\u061A\\u064B-\\u065F\\u0670\\u06D6-\\u06DC\\u06DF-\\u06E4\\u06E7\\u06E8\\u06EA-\\u06ED\\u0711\\u0730-\\u074A\\u07A6-\\u07B0\\u07EB-\\u07F3\\u0816-\\u0819\\u081B-\\u0823\\u0825-\\u0827\\u0829-\\u082D\\u0859-\\u085B\\u08E4-\\u08FE\\u0900-\\u0903\\u093A-\\u093C\\u093E-\\u094F\\u0951-\\u0957\\u0962\\u0963\\u0981-\\u0983\\u09BC\\u09BE-\\u09C4\\u09C7\\u09C8\\u09CB-\\u09CD\\u09D7\\u09E2\\u09E3\\u0A01-\\u0A03\\u0A3C\\u0A3E-\\u0A42\\u0A47\\u0A48\\u0A4B-\\u0A4D\\u0A51\\u0A70\\u0A71\\u0A75\\u0A81-\\u0A83\\u0ABC\\u0ABE-\\u0AC5\\u0AC7-\\u0AC9\\u0ACB-\\u0ACD\\u0AE2\\u0AE3\\u0B01-\\u0B03\\u0B3C\\u0B3E-\\u0B44\\u0B47\\u0B48\\u0B4B-\\u0B4D\\u0B56\\u0B57\\u0B62\\u0B63\\u0B82\\u0BBE-\\u0BC2\\u0BC6-\\u0BC8\\u0BCA-\\u0BCD\\u0BD7\\u0C01-\\u0C03\\u0C3E-\\u0C44\\u0C46-\\u0C48\\u0C4A-\\u0C4D\\u0C55\\u0C56\\u0C62\\u0C63\\u0C82\\u0C83\\u0CBC\\u0CBE-\\u0CC4\\u0CC6-\\u0CC8\\u0CCA-\\u0CCD\\u0CD5\\u0CD6\\u0CE2\\u0CE3\\u0D02\\u0D03\\u0D3E-\\u0D44\\u0D46-\\u0D48\\u0D4A-\\u0D4D\\u0D57\\u0D62\\u0D63\\u0D82\\u0D83\\u0DCA\\u0DCF-\\u0DD4\\u0DD6\\u0DD8-\\u0DDF\\u0DF2\\u0DF3\\u0E31\\u0E34-\\u0E3A\\u0E47-\\u0E4E\\u0EB1\\u0EB4-\\u0EB9\\u0EBB\\u0EBC\\u0EC8-\\u0ECD\\u0F18\\u0F19\\u0F35\\u0F37\\u0F39\\u0F3E\\u0F3F\\u0F71-\\u0F84\\u0F86\\u0F87\\u0F8D-\\u0F97\\u0F99-\\u0FBC\\u0FC6\\u102B-\\u103E\\u1056-\\u1059\\u105E-\\u1060\\u1062-\\u1064\\u1067-\\u106D\\u1071-\\u1074\\u1082-\\u108D\\u108F\\u109A-\\u109D\\u135D-\\u135F\\u1712-\\u1714\\u1732-\\u1734\\u1752\\u1753\\u1772\\u1773\\u17B4-\\u17D3\\u17DD\\u180B-\\u180D\\u18A9\\u1920-\\u192B\\u1930-\\u193B\\u19B0-\\u19C0\\u19C8\\u19C9\\u1A17-\\u1A1B\\u1A55-\\u1A5E\\u1A60-\\u1A7C\\u1A7F\\u1B00-\\u1B04\\u1B34-\\u1B44\\u1B6B-\\u1B73\\u1B80-\\u1B82\\u1BA1-\\u1BAD\\u1BE6-\\u1BF3\\u1C24-\\u1C37\\u1CD0-\\u1CD2\\u1CD4-\\u1CE8\\u1CED\\u1CF2-\\u1CF4\\u1DC0-\\u1DE6\\u1DFC-\\u1DFF\\u20D0-\\u20DC\\u20E1\\u20E5-\\u20F0\\u2CEF-\\u2CF1\\u2D7F\\u2DE0-\\u2DFF\\u302A-\\u302F\\u3099\\u309A\\uA66F\\uA674-\\uA67D\\uA69F\\uA6F0\\uA6F1\\uA802\\uA806\\uA80B\\uA823-\\uA827\\uA880\\uA881\\uA8B4-\\uA8C4\\uA8E0-\\uA8F1\\uA926-\\uA92D\\uA947-\\uA953\\uA980-\\uA983\\uA9B3-\\uA9C0\\uAA29-\\uAA36\\uAA43\\uAA4C\\uAA4D\\uAA7B\\uAAB0\\uAAB2-\\uAAB4\\uAAB7\\uAAB8\\uAABE\\uAABF\\uAAC1\\uAAEB-\\uAAEF\\uAAF5\\uAAF6\\uABE3-\\uABEA\\uABEC\\uABED\\uFB1E\\uFE00-\\uFE0F\\uFE20-\\uFE26]"), + connector_punctuation: new RegExp("[\\u005F\\u203F\\u2040\\u2054\\uFE33\\uFE34\\uFE4D-\\uFE4F\\uFF3F]"), + digit: new RegExp("[\\u0030-\\u0039\\u0660-\\u0669\\u06F0-\\u06F9\\u07C0-\\u07C9\\u0966-\\u096F\\u09E6-\\u09EF\\u0A66-\\u0A6F\\u0AE6-\\u0AEF\\u0B66-\\u0B6F\\u0BE6-\\u0BEF\\u0C66-\\u0C6F\\u0CE6-\\u0CEF\\u0D66-\\u0D6F\\u0E50-\\u0E59\\u0ED0-\\u0ED9\\u0F20-\\u0F29\\u1040-\\u1049\\u1090-\\u1099\\u17E0-\\u17E9\\u1810-\\u1819\\u1946-\\u194F\\u19D0-\\u19D9\\u1A80-\\u1A89\\u1A90-\\u1A99\\u1B50-\\u1B59\\u1BB0-\\u1BB9\\u1C40-\\u1C49\\u1C50-\\u1C59\\uA620-\\uA629\\uA8D0-\\uA8D9\\uA900-\\uA909\\uA9D0-\\uA9D9\\uAA50-\\uAA59\\uABF0-\\uABF9\\uFF10-\\uFF19]") +}; + +function is_letter(ch) { + return UNICODE.letter.test(ch); +}; + +function is_digit(ch) { + ch = ch.charCodeAt(0); + return ch >= 48 && ch <= 57; +}; + +function is_unicode_digit(ch) { + return UNICODE.digit.test(ch); +} + +function is_alphanumeric_char(ch) { + return is_digit(ch) || is_letter(ch); +}; + +function is_unicode_combining_mark(ch) { + return UNICODE.combining_mark.test(ch); +}; + +function is_unicode_connector_punctuation(ch) { + return UNICODE.connector_punctuation.test(ch); +}; + +function is_identifier_start(ch) { + return ch == "$" || ch == "_" || is_letter(ch); +}; + +function is_identifier_char(ch) { + return is_identifier_start(ch) + || is_unicode_combining_mark(ch) + || is_unicode_digit(ch) + || is_unicode_connector_punctuation(ch) + || ch == "\u200c" // zero-width non-joiner + || ch == "\u200d" // zero-width joiner (in my ECMA-262 PDF, this is also 200c) + ; +}; + +function parse_js_number(num) { + if (RE_HEX_NUMBER.test(num)) { + return parseInt(num.substr(2), 16); + } else if (RE_OCT_NUMBER.test(num)) { + return parseInt(num.substr(1), 8); + } else if (RE_DEC_NUMBER.test(num)) { + return parseFloat(num); + } +}; + +function JS_Parse_Error(message, line, col, pos) { + this.message = message; + this.line = line + 1; + this.col = col + 1; + this.pos = pos + 1; + this.stack = new Error().stack; +}; + +JS_Parse_Error.prototype.toString = function() { + return this.message + " (line: " + this.line + ", col: " + this.col + ", pos: " + this.pos + ")" + "\n\n" + this.stack; +}; + +function js_error(message, line, col, pos) { + throw new JS_Parse_Error(message, line, col, pos); +}; + +function is_token(token, type, val) { + return token.type == type && (val == null || token.value == val); +}; + +var EX_EOF = {}; + +function tokenizer($TEXT) { + + var S = { + text : $TEXT.replace(/\r\n?|[\n\u2028\u2029]/g, "\n").replace(/^\uFEFF/, ''), + pos : 0, + tokpos : 0, + line : 0, + tokline : 0, + col : 0, + tokcol : 0, + newline_before : false, + regex_allowed : false, + comments_before : [] + }; + + function peek() { return S.text.charAt(S.pos); }; + + function next(signal_eof, in_string) { + var ch = S.text.charAt(S.pos++); + if (signal_eof && !ch) + throw EX_EOF; + if (ch == "\n") { + S.newline_before = S.newline_before || !in_string; + ++S.line; + S.col = 0; + } else { + ++S.col; + } + return ch; + }; + + function eof() { + return !S.peek(); + }; + + function find(what, signal_eof) { + var pos = S.text.indexOf(what, S.pos); + if (signal_eof && pos == -1) throw EX_EOF; + return pos; + }; + + function start_token() { + S.tokline = S.line; + S.tokcol = S.col; + S.tokpos = S.pos; + }; + + function token(type, value, is_comment) { + S.regex_allowed = ((type == "operator" && !HOP(UNARY_POSTFIX, value)) || + (type == "keyword" && HOP(KEYWORDS_BEFORE_EXPRESSION, value)) || + (type == "punc" && HOP(PUNC_BEFORE_EXPRESSION, value))); + var ret = { + type : type, + value : value, + line : S.tokline, + col : S.tokcol, + pos : S.tokpos, + endpos : S.pos, + nlb : S.newline_before + }; + if (!is_comment) { + ret.comments_before = S.comments_before; + S.comments_before = []; + // make note of any newlines in the comments that came before + for (var i = 0, len = ret.comments_before.length; i < len; i++) { + ret.nlb = ret.nlb || ret.comments_before[i].nlb; + } + } + S.newline_before = false; + return ret; + }; + + function skip_whitespace() { + while (HOP(WHITESPACE_CHARS, peek())) + next(); + }; + + function read_while(pred) { + var ret = "", ch = peek(), i = 0; + while (ch && pred(ch, i++)) { + ret += next(); + ch = peek(); + } + return ret; + }; + + function parse_error(err) { + js_error(err, S.tokline, S.tokcol, S.tokpos); + }; + + function read_num(prefix) { + var has_e = false, after_e = false, has_x = false, has_dot = prefix == "."; + var num = read_while(function(ch, i){ + if (ch == "x" || ch == "X") { + if (has_x) return false; + return has_x = true; + } + if (!has_x && (ch == "E" || ch == "e")) { + if (has_e) return false; + return has_e = after_e = true; + } + if (ch == "-") { + if (after_e || (i == 0 && !prefix)) return true; + return false; + } + if (ch == "+") return after_e; + after_e = false; + if (ch == ".") { + if (!has_dot && !has_x && !has_e) + return has_dot = true; + return false; + } + return is_alphanumeric_char(ch); + }); + if (prefix) + num = prefix + num; + var valid = parse_js_number(num); + if (!isNaN(valid)) { + return token("num", valid); + } else { + parse_error("Invalid syntax: " + num); + } + }; + + function read_escaped_char(in_string) { + var ch = next(true, in_string); + switch (ch) { + case "n" : return "\n"; + case "r" : return "\r"; + case "t" : return "\t"; + case "b" : return "\b"; + case "v" : return "\u000b"; + case "f" : return "\f"; + case "0" : return "\0"; + case "x" : return String.fromCharCode(hex_bytes(2)); + case "u" : return String.fromCharCode(hex_bytes(4)); + case "\n": return ""; + default : return ch; + } + }; + + function hex_bytes(n) { + var num = 0; + for (; n > 0; --n) { + var digit = parseInt(next(true), 16); + if (isNaN(digit)) + parse_error("Invalid hex-character pattern in string"); + num = (num << 4) | digit; + } + return num; + }; + + function read_string() { + return with_eof_error("Unterminated string constant", function(){ + var quote = next(), ret = ""; + for (;;) { + var ch = next(true); + if (ch == "\\") { + // read OctalEscapeSequence (XXX: deprecated if "strict mode") + // https://github.com/mishoo/UglifyJS/issues/178 + var octal_len = 0, first = null; + ch = read_while(function(ch){ + if (ch >= "0" && ch <= "7") { + if (!first) { + first = ch; + return ++octal_len; + } + else if (first <= "3" && octal_len <= 2) return ++octal_len; + else if (first >= "4" && octal_len <= 1) return ++octal_len; + } + return false; + }); + if (octal_len > 0) ch = String.fromCharCode(parseInt(ch, 8)); + else ch = read_escaped_char(true); + } + else if (ch == quote) break; + ret += ch; + } + return token("string", ret); + }); + }; + + function read_line_comment() { + next(); + var i = find("\n"), ret; + if (i == -1) { + ret = S.text.substr(S.pos); + S.pos = S.text.length; + } else { + ret = S.text.substring(S.pos, i); + S.pos = i; + } + return token("comment1", ret, true); + }; + + function read_multiline_comment() { + next(); + return with_eof_error("Unterminated multiline comment", function(){ + var i = find("*/", true), + text = S.text.substring(S.pos, i); + S.pos = i + 2; + S.line += text.split("\n").length - 1; + S.newline_before = S.newline_before || text.indexOf("\n") >= 0; + + // https://github.com/mishoo/UglifyJS/issues/#issue/100 + if (/^@cc_on/i.test(text)) { + warn("WARNING: at line " + S.line); + warn("*** Found \"conditional comment\": " + text); + warn("*** UglifyJS DISCARDS ALL COMMENTS. This means your code might no longer work properly in Internet Explorer."); + } + + return token("comment2", text, true); + }); + }; + + function read_name() { + var backslash = false, name = "", ch, escaped = false, hex; + while ((ch = peek()) != null) { + if (!backslash) { + if (ch == "\\") escaped = backslash = true, next(); + else if (is_identifier_char(ch)) name += next(); + else break; + } + else { + if (ch != "u") parse_error("Expecting UnicodeEscapeSequence -- uXXXX"); + ch = read_escaped_char(); + if (!is_identifier_char(ch)) parse_error("Unicode char: " + ch.charCodeAt(0) + " is not valid in identifier"); + name += ch; + backslash = false; + } + } + if (HOP(KEYWORDS, name) && escaped) { + hex = name.charCodeAt(0).toString(16).toUpperCase(); + name = "\\u" + "0000".substr(hex.length) + hex + name.slice(1); + } + return name; + }; + + function read_regexp(regexp) { + return with_eof_error("Unterminated regular expression", function(){ + var prev_backslash = false, ch, in_class = false; + while ((ch = next(true))) if (prev_backslash) { + regexp += "\\" + ch; + prev_backslash = false; + } else if (ch == "[") { + in_class = true; + regexp += ch; + } else if (ch == "]" && in_class) { + in_class = false; + regexp += ch; + } else if (ch == "/" && !in_class) { + break; + } else if (ch == "\\") { + prev_backslash = true; + } else { + regexp += ch; + } + var mods = read_name(); + return token("regexp", [ regexp, mods ]); + }); + }; + + function read_operator(prefix) { + function grow(op) { + if (!peek()) return op; + var bigger = op + peek(); + if (HOP(OPERATORS, bigger)) { + next(); + return grow(bigger); + } else { + return op; + } + }; + return token("operator", grow(prefix || next())); + }; + + function handle_slash() { + next(); + var regex_allowed = S.regex_allowed; + switch (peek()) { + case "/": + S.comments_before.push(read_line_comment()); + S.regex_allowed = regex_allowed; + return next_token(); + case "*": + S.comments_before.push(read_multiline_comment()); + S.regex_allowed = regex_allowed; + return next_token(); + } + return S.regex_allowed ? read_regexp("") : read_operator("/"); + }; + + function handle_dot() { + next(); + return is_digit(peek()) + ? read_num(".") + : token("punc", "."); + }; + + function read_word() { + var word = read_name(); + return !HOP(KEYWORDS, word) + ? token("name", word) + : HOP(OPERATORS, word) + ? token("operator", word) + : HOP(KEYWORDS_ATOM, word) + ? token("atom", word) + : token("keyword", word); + }; + + function with_eof_error(eof_error, cont) { + try { + return cont(); + } catch(ex) { + if (ex === EX_EOF) parse_error(eof_error); + else throw ex; + } + }; + + function next_token(force_regexp) { + if (force_regexp != null) + return read_regexp(force_regexp); + skip_whitespace(); + start_token(); + var ch = peek(); + if (!ch) return token("eof"); + if (is_digit(ch)) return read_num(); + if (ch == '"' || ch == "'") return read_string(); + if (HOP(PUNC_CHARS, ch)) return token("punc", next()); + if (ch == ".") return handle_dot(); + if (ch == "/") return handle_slash(); + if (HOP(OPERATOR_CHARS, ch)) return read_operator(); + if (ch == "\\" || is_identifier_start(ch)) return read_word(); + parse_error("Unexpected character '" + ch + "'"); + }; + + next_token.context = function(nc) { + if (nc) S = nc; + return S; + }; + + return next_token; + +}; + +/* -----[ Parser (constants) ]----- */ + +var UNARY_PREFIX = array_to_hash([ + "typeof", + "void", + "delete", + "--", + "++", + "!", + "~", + "-", + "+" +]); + +var UNARY_POSTFIX = array_to_hash([ "--", "++" ]); + +var ASSIGNMENT = (function(a, ret, i){ + while (i < a.length) { + ret[a[i]] = a[i].substr(0, a[i].length - 1); + i++; + } + return ret; +})( + ["+=", "-=", "/=", "*=", "%=", ">>=", "<<=", ">>>=", "|=", "^=", "&="], + { "=": true }, + 0 +); + +var PRECEDENCE = (function(a, ret){ + for (var i = 0, n = 1; i < a.length; ++i, ++n) { + var b = a[i]; + for (var j = 0; j < b.length; ++j) { + ret[b[j]] = n; + } + } + return ret; +})( + [ + ["||"], + ["&&"], + ["|"], + ["^"], + ["&"], + ["==", "===", "!=", "!=="], + ["<", ">", "<=", ">=", "in", "instanceof"], + [">>", "<<", ">>>"], + ["+", "-"], + ["*", "/", "%"] + ], + {} +); + +var STATEMENTS_WITH_LABELS = array_to_hash([ "for", "do", "while", "switch" ]); + +var ATOMIC_START_TOKEN = array_to_hash([ "atom", "num", "string", "regexp", "name" ]); + +/* -----[ Parser ]----- */ + +function NodeWithToken(str, start, end) { + this.name = str; + this.start = start; + this.end = end; +}; + +NodeWithToken.prototype.toString = function() { return this.name; }; + +function parse($TEXT, exigent_mode, embed_tokens) { + + var S = { + input : typeof $TEXT == "string" ? tokenizer($TEXT, true) : $TEXT, + token : null, + prev : null, + peeked : null, + in_function : 0, + in_directives : true, + in_loop : 0, + labels : [] + }; + + S.token = next(); + + function is(type, value) { + return is_token(S.token, type, value); + }; + + function peek() { return S.peeked || (S.peeked = S.input()); }; + + function next() { + S.prev = S.token; + if (S.peeked) { + S.token = S.peeked; + S.peeked = null; + } else { + S.token = S.input(); + } + S.in_directives = S.in_directives && ( + S.token.type == "string" || is("punc", ";") + ); + return S.token; + }; + + function prev() { + return S.prev; + }; + + function croak(msg, line, col, pos) { + var ctx = S.input.context(); + js_error(msg, + line != null ? line : ctx.tokline, + col != null ? col : ctx.tokcol, + pos != null ? pos : ctx.tokpos); + }; + + function token_error(token, msg) { + croak(msg, token.line, token.col); + }; + + function unexpected(token) { + if (token == null) + token = S.token; + token_error(token, "Unexpected token: " + token.type + " (" + token.value + ")"); + }; + + function expect_token(type, val) { + if (is(type, val)) { + return next(); + } + token_error(S.token, "Unexpected token " + S.token.type + ", expected " + type); + }; + + function expect(punc) { return expect_token("punc", punc); }; + + function can_insert_semicolon() { + return !exigent_mode && ( + S.token.nlb || is("eof") || is("punc", "}") + ); + }; + + function semicolon() { + if (is("punc", ";")) next(); + else if (!can_insert_semicolon()) unexpected(); + }; + + function as() { + return slice(arguments); + }; + + function parenthesised() { + expect("("); + var ex = expression(); + expect(")"); + return ex; + }; + + function add_tokens(str, start, end) { + return str instanceof NodeWithToken ? str : new NodeWithToken(str, start, end); + }; + + function maybe_embed_tokens(parser) { + if (embed_tokens) return function() { + var start = S.token; + var ast = parser.apply(this, arguments); + ast[0] = add_tokens(ast[0], start, prev()); + return ast; + }; + else return parser; + }; + + var statement = maybe_embed_tokens(function() { + if (is("operator", "/") || is("operator", "/=")) { + S.peeked = null; + S.token = S.input(S.token.value.substr(1)); // force regexp + } + switch (S.token.type) { + case "string": + var dir = S.in_directives, stat = simple_statement(); + if (dir && stat[1][0] == "string" && !is("punc", ",")) + return as("directive", stat[1][1]); + return stat; + case "num": + case "regexp": + case "operator": + case "atom": + return simple_statement(); + + case "name": + return is_token(peek(), "punc", ":") + ? labeled_statement(prog1(S.token.value, next, next)) + : simple_statement(); + + case "punc": + switch (S.token.value) { + case "{": + return as("block", block_()); + case "[": + case "(": + return simple_statement(); + case ";": + next(); + return as("block"); + default: + unexpected(); + } + + case "keyword": + switch (prog1(S.token.value, next)) { + case "break": + return break_cont("break"); + + case "continue": + return break_cont("continue"); + + case "debugger": + semicolon(); + return as("debugger"); + + case "do": + return (function(body){ + expect_token("keyword", "while"); + return as("do", prog1(parenthesised, semicolon), body); + })(in_loop(statement)); + + case "for": + return for_(); + + case "function": + return function_(true); + + case "if": + return if_(); + + case "return": + if (S.in_function == 0) + croak("'return' outside of function"); + return as("return", + is("punc", ";") + ? (next(), null) + : can_insert_semicolon() + ? null + : prog1(expression, semicolon)); + + case "switch": + return as("switch", parenthesised(), switch_block_()); + + case "throw": + if (S.token.nlb) + croak("Illegal newline after 'throw'"); + return as("throw", prog1(expression, semicolon)); + + case "try": + return try_(); + + case "var": + return prog1(var_, semicolon); + + case "const": + return prog1(const_, semicolon); + + case "while": + return as("while", parenthesised(), in_loop(statement)); + + case "with": + return as("with", parenthesised(), statement()); + + default: + unexpected(); + } + } + }); + + function labeled_statement(label) { + S.labels.push(label); + var start = S.token, stat = statement(); + if (exigent_mode && !HOP(STATEMENTS_WITH_LABELS, stat[0])) + unexpected(start); + S.labels.pop(); + return as("label", label, stat); + }; + + function simple_statement() { + return as("stat", prog1(expression, semicolon)); + }; + + function break_cont(type) { + var name; + if (!can_insert_semicolon()) { + name = is("name") ? S.token.value : null; + } + if (name != null) { + next(); + if (!member(name, S.labels)) + croak("Label " + name + " without matching loop or statement"); + } + else if (S.in_loop == 0) + croak(type + " not inside a loop or switch"); + semicolon(); + return as(type, name); + }; + + function for_() { + expect("("); + var init = null; + if (!is("punc", ";")) { + init = is("keyword", "var") + ? (next(), var_(true)) + : expression(true, true); + if (is("operator", "in")) { + if (init[0] == "var" && init[1].length > 1) + croak("Only one variable declaration allowed in for..in loop"); + return for_in(init); + } + } + return regular_for(init); + }; + + function regular_for(init) { + expect(";"); + var test = is("punc", ";") ? null : expression(); + expect(";"); + var step = is("punc", ")") ? null : expression(); + expect(")"); + return as("for", init, test, step, in_loop(statement)); + }; + + function for_in(init) { + var lhs = init[0] == "var" ? as("name", init[1][0]) : init; + next(); + var obj = expression(); + expect(")"); + return as("for-in", init, lhs, obj, in_loop(statement)); + }; + + var function_ = function(in_statement) { + var name = is("name") ? prog1(S.token.value, next) : null; + if (in_statement && !name) + unexpected(); + expect("("); + return as(in_statement ? "defun" : "function", + name, + // arguments + (function(first, a){ + while (!is("punc", ")")) { + if (first) first = false; else expect(","); + if (!is("name")) unexpected(); + a.push(S.token.value); + next(); + } + next(); + return a; + })(true, []), + // body + (function(){ + ++S.in_function; + var loop = S.in_loop; + S.in_directives = true; + S.in_loop = 0; + var a = block_(); + --S.in_function; + S.in_loop = loop; + return a; + })()); + }; + + function if_() { + var cond = parenthesised(), body = statement(), belse; + if (is("keyword", "else")) { + next(); + belse = statement(); + } + return as("if", cond, body, belse); + }; + + function block_() { + expect("{"); + var a = []; + while (!is("punc", "}")) { + if (is("eof")) unexpected(); + a.push(statement()); + } + next(); + return a; + }; + + var switch_block_ = curry(in_loop, function(){ + expect("{"); + var a = [], cur = null; + while (!is("punc", "}")) { + if (is("eof")) unexpected(); + if (is("keyword", "case")) { + next(); + cur = []; + a.push([ expression(), cur ]); + expect(":"); + } + else if (is("keyword", "default")) { + next(); + expect(":"); + cur = []; + a.push([ null, cur ]); + } + else { + if (!cur) unexpected(); + cur.push(statement()); + } + } + next(); + return a; + }); + + function try_() { + var body = block_(), bcatch, bfinally; + if (is("keyword", "catch")) { + next(); + expect("("); + if (!is("name")) + croak("Name expected"); + var name = S.token.value; + next(); + expect(")"); + bcatch = [ name, block_() ]; + } + if (is("keyword", "finally")) { + next(); + bfinally = block_(); + } + if (!bcatch && !bfinally) + croak("Missing catch/finally blocks"); + return as("try", body, bcatch, bfinally); + }; + + function vardefs(no_in) { + var a = []; + for (;;) { + if (!is("name")) + unexpected(); + var name = S.token.value; + next(); + if (is("operator", "=")) { + next(); + a.push([ name, expression(false, no_in) ]); + } else { + a.push([ name ]); + } + if (!is("punc", ",")) + break; + next(); + } + return a; + }; + + function var_(no_in) { + return as("var", vardefs(no_in)); + }; + + function const_() { + return as("const", vardefs()); + }; + + function new_() { + var newexp = expr_atom(false), args; + if (is("punc", "(")) { + next(); + args = expr_list(")"); + } else { + args = []; + } + return subscripts(as("new", newexp, args), true); + }; + + var expr_atom = maybe_embed_tokens(function(allow_calls) { + if (is("operator", "new")) { + next(); + return new_(); + } + if (is("punc")) { + switch (S.token.value) { + case "(": + next(); + return subscripts(prog1(expression, curry(expect, ")")), allow_calls); + case "[": + next(); + return subscripts(array_(), allow_calls); + case "{": + next(); + return subscripts(object_(), allow_calls); + } + unexpected(); + } + if (is("keyword", "function")) { + next(); + return subscripts(function_(false), allow_calls); + } + if (HOP(ATOMIC_START_TOKEN, S.token.type)) { + var atom = S.token.type == "regexp" + ? as("regexp", S.token.value[0], S.token.value[1]) + : as(S.token.type, S.token.value); + return subscripts(prog1(atom, next), allow_calls); + } + unexpected(); + }); + + function expr_list(closing, allow_trailing_comma, allow_empty) { + var first = true, a = []; + while (!is("punc", closing)) { + if (first) first = false; else expect(","); + if (allow_trailing_comma && is("punc", closing)) break; + if (is("punc", ",") && allow_empty) { + a.push([ "atom", "undefined" ]); + } else { + a.push(expression(false)); + } + } + next(); + return a; + }; + + function array_() { + return as("array", expr_list("]", !exigent_mode, true)); + }; + + function object_() { + var first = true, a = []; + while (!is("punc", "}")) { + if (first) first = false; else expect(","); + if (!exigent_mode && is("punc", "}")) + // allow trailing comma + break; + var type = S.token.type; + var name = as_property_name(); + if (type == "name" && (name == "get" || name == "set") && !is("punc", ":")) { + a.push([ as_name(), function_(false), name ]); + } else { + expect(":"); + a.push([ name, expression(false) ]); + } + // FIXME [!!] Line not in original parse-js, + // added to be able to warn about unquoted + // keyword properties + a[a.length - 1].type = type; + } + next(); + return as("object", a); + }; + + function as_property_name() { + switch (S.token.type) { + case "num": + case "string": + return prog1(S.token.value, next); + } + return as_name(); + }; + + function as_name() { + switch (S.token.type) { + case "name": + case "operator": + case "keyword": + case "atom": + return prog1(S.token.value, next); + default: + unexpected(); + } + }; + + function subscripts(expr, allow_calls) { + if (is("punc", ".")) { + next(); + return subscripts(as("dot", expr, as_name()), allow_calls); + } + if (is("punc", "[")) { + next(); + return subscripts(as("sub", expr, prog1(expression, curry(expect, "]"))), allow_calls); + } + if (allow_calls && is("punc", "(")) { + next(); + return subscripts(as("call", expr, expr_list(")")), true); + } + return expr; + }; + + function maybe_unary(allow_calls) { + if (is("operator") && HOP(UNARY_PREFIX, S.token.value)) { + return make_unary("unary-prefix", + prog1(S.token.value, next), + maybe_unary(allow_calls)); + } + var val = expr_atom(allow_calls); + while (is("operator") && HOP(UNARY_POSTFIX, S.token.value) && !S.token.nlb) { + val = make_unary("unary-postfix", S.token.value, val); + next(); + } + return val; + }; + + function make_unary(tag, op, expr) { + if ((op == "++" || op == "--") && !is_assignable(expr)) + croak("Invalid use of " + op + " operator"); + return as(tag, op, expr); + }; + + function expr_op(left, min_prec, no_in) { + var op = is("operator") ? S.token.value : null; + if (op && op == "in" && no_in) op = null; + var prec = op != null ? PRECEDENCE[op] : null; + if (prec != null && prec > min_prec) { + next(); + var right = expr_op(maybe_unary(true), prec, no_in); + return expr_op(as("binary", op, left, right), min_prec, no_in); + } + return left; + }; + + function expr_ops(no_in) { + return expr_op(maybe_unary(true), 0, no_in); + }; + + function maybe_conditional(no_in) { + var expr = expr_ops(no_in); + if (is("operator", "?")) { + next(); + var yes = expression(false); + expect(":"); + return as("conditional", expr, yes, expression(false, no_in)); + } + return expr; + }; + + function is_assignable(expr) { + if (!exigent_mode) return true; + switch (expr[0]+"") { + case "dot": + case "sub": + case "new": + case "call": + return true; + case "name": + return expr[1] != "this"; + } + }; + + function maybe_assign(no_in) { + var left = maybe_conditional(no_in), val = S.token.value; + if (is("operator") && HOP(ASSIGNMENT, val)) { + if (is_assignable(left)) { + next(); + return as("assign", ASSIGNMENT[val], left, maybe_assign(no_in)); + } + croak("Invalid assignment"); + } + return left; + }; + + var expression = maybe_embed_tokens(function(commas, no_in) { + if (arguments.length == 0) + commas = true; + var expr = maybe_assign(no_in); + if (commas && is("punc", ",")) { + next(); + return as("seq", expr, expression(true, no_in)); + } + return expr; + }); + + function in_loop(cont) { + try { + ++S.in_loop; + return cont(); + } finally { + --S.in_loop; + } + }; + + return as("toplevel", (function(a){ + while (!is("eof")) + a.push(statement()); + return a; + })([])); + +}; + +/* -----[ Utilities ]----- */ + +function curry(f) { + var args = slice(arguments, 1); + return function() { return f.apply(this, args.concat(slice(arguments))); }; +}; + +function prog1(ret) { + if (ret instanceof Function) + ret = ret(); + for (var i = 1, n = arguments.length; --n > 0; ++i) + arguments[i](); + return ret; +}; + +function array_to_hash(a) { + var ret = {}; + for (var i = 0; i < a.length; ++i) + ret[a[i]] = true; + return ret; +}; + +function slice(a, start) { + return Array.prototype.slice.call(a, start || 0); +}; + +function characters(str) { + return str.split(""); +}; + +function member(name, array) { + for (var i = array.length; --i >= 0;) + if (array[i] == name) + return true; + return false; +}; + +function HOP(obj, prop) { + return Object.prototype.hasOwnProperty.call(obj, prop); +}; + +var warn = function() {}; + +/* -----[ Exports ]----- */ + +exports.tokenizer = tokenizer; +exports.parse = parse; +exports.slice = slice; +exports.curry = curry; +exports.member = member; +exports.array_to_hash = array_to_hash; +exports.PRECEDENCE = PRECEDENCE; +exports.KEYWORDS_ATOM = KEYWORDS_ATOM; +exports.RESERVED_WORDS = RESERVED_WORDS; +exports.KEYWORDS = KEYWORDS; +exports.ATOMIC_START_TOKEN = ATOMIC_START_TOKEN; +exports.OPERATORS = OPERATORS; +exports.is_alphanumeric_char = is_alphanumeric_char; +exports.is_identifier_start = is_identifier_start; +exports.is_identifier_char = is_identifier_char; +exports.set_logger = function(logger) { + warn = logger; +}; + +// Local variables: +// js-indent-level: 8 +// End: diff --git a/MixERP.Net.FrontEnd/Scripts/CodeMirror/test/lint/walk.js b/MixERP.Net.FrontEnd/Scripts/CodeMirror/test/lint/walk.js new file mode 100644 index 000000000..97321acfc --- /dev/null +++ b/MixERP.Net.FrontEnd/Scripts/CodeMirror/test/lint/walk.js @@ -0,0 +1,216 @@ +// AST walker module for Mozilla Parser API compatible trees + +(function(exports) { + "use strict"; + + // A simple walk is one where you simply specify callbacks to be + // called on specific nodes. The last two arguments are optional. A + // simple use would be + // + // walk.simple(myTree, { + // Expression: function(node) { ... } + // }); + // + // to do something with all expressions. All Parser API node types + // can be used to identify node types, as well as Expression, + // Statement, and ScopeBody, which denote categories of nodes. + // + // The base argument can be used to pass a custom (recursive) + // walker, and state can be used to give this walked an initial + // state. + exports.simple = function(node, visitors, base, state) { + if (!base) base = exports; + function c(node, st, override) { + var type = override || node.type, found = visitors[type]; + if (found) found(node, st); + base[type](node, st, c); + } + c(node, state); + }; + + // A recursive walk is one where your functions override the default + // walkers. They can modify and replace the state parameter that's + // threaded through the walk, and can opt how and whether to walk + // their child nodes (by calling their third argument on these + // nodes). + exports.recursive = function(node, state, funcs, base) { + var visitor = exports.make(funcs, base); + function c(node, st, override) { + visitor[override || node.type](node, st, c); + } + c(node, state); + }; + + // Used to create a custom walker. Will fill in all missing node + // type properties with the defaults. + exports.make = function(funcs, base) { + if (!base) base = exports; + var visitor = {}; + for (var type in base) + visitor[type] = funcs.hasOwnProperty(type) ? funcs[type] : base[type]; + return visitor; + }; + + function skipThrough(node, st, c) { c(node, st); } + function ignore(node, st, c) {} + + // Node walkers. + + exports.Program = exports.BlockStatement = function(node, st, c) { + for (var i = 0; i < node.body.length; ++i) + c(node.body[i], st, "Statement"); + }; + exports.Statement = skipThrough; + exports.EmptyStatement = ignore; + exports.ExpressionStatement = function(node, st, c) { + c(node.expression, st, "Expression"); + }; + exports.IfStatement = function(node, st, c) { + c(node.test, st, "Expression"); + c(node.consequent, st, "Statement"); + if (node.alternate) c(node.alternate, st, "Statement"); + }; + exports.LabeledStatement = function(node, st, c) { + c(node.body, st, "Statement"); + }; + exports.BreakStatement = exports.ContinueStatement = ignore; + exports.WithStatement = function(node, st, c) { + c(node.object, st, "Expression"); + c(node.body, st, "Statement"); + }; + exports.SwitchStatement = function(node, st, c) { + c(node.discriminant, st, "Expression"); + for (var i = 0; i < node.cases.length; ++i) { + var cs = node.cases[i]; + if (cs.test) c(cs.test, st, "Expression"); + for (var j = 0; j < cs.consequent.length; ++j) + c(cs.consequent[j], st, "Statement"); + } + }; + exports.ReturnStatement = function(node, st, c) { + if (node.argument) c(node.argument, st, "Expression"); + }; + exports.ThrowStatement = function(node, st, c) { + c(node.argument, st, "Expression"); + }; + exports.TryStatement = function(node, st, c) { + c(node.block, st, "Statement"); + for (var i = 0; i < node.handlers.length; ++i) + c(node.handlers[i].body, st, "ScopeBody"); + if (node.finalizer) c(node.finalizer, st, "Statement"); + }; + exports.WhileStatement = function(node, st, c) { + c(node.test, st, "Expression"); + c(node.body, st, "Statement"); + }; + exports.DoWhileStatement = exports.WhileStatement; + exports.ForStatement = function(node, st, c) { + if (node.init) c(node.init, st, "ForInit"); + if (node.test) c(node.test, st, "Expression"); + if (node.update) c(node.update, st, "Expression"); + c(node.body, st, "Statement"); + }; + exports.ForInStatement = function(node, st, c) { + c(node.left, st, "ForInit"); + c(node.right, st, "Expression"); + c(node.body, st, "Statement"); + }; + exports.ForInit = function(node, st, c) { + if (node.type == "VariableDeclaration") c(node, st); + else c(node, st, "Expression"); + }; + exports.DebuggerStatement = ignore; + + exports.FunctionDeclaration = function(node, st, c) { + c(node, st, "Function"); + }; + exports.VariableDeclaration = function(node, st, c) { + for (var i = 0; i < node.declarations.length; ++i) { + var decl = node.declarations[i]; + if (decl.init) c(decl.init, st, "Expression"); + } + }; + + exports.Function = function(node, st, c) { + c(node.body, st, "ScopeBody"); + }; + exports.ScopeBody = function(node, st, c) { + c(node, st, "Statement"); + }; + + exports.Expression = skipThrough; + exports.ThisExpression = ignore; + exports.ArrayExpression = function(node, st, c) { + for (var i = 0; i < node.elements.length; ++i) { + var elt = node.elements[i]; + if (elt) c(elt, st, "Expression"); + } + }; + exports.ObjectExpression = function(node, st, c) { + for (var i = 0; i < node.properties.length; ++i) + c(node.properties[i].value, st, "Expression"); + }; + exports.FunctionExpression = exports.FunctionDeclaration; + exports.SequenceExpression = function(node, st, c) { + for (var i = 0; i < node.expressions.length; ++i) + c(node.expressions[i], st, "Expression"); + }; + exports.UnaryExpression = exports.UpdateExpression = function(node, st, c) { + c(node.argument, st, "Expression"); + }; + exports.BinaryExpression = exports.AssignmentExpression = exports.LogicalExpression = function(node, st, c) { + c(node.left, st, "Expression"); + c(node.right, st, "Expression"); + }; + exports.ConditionalExpression = function(node, st, c) { + c(node.test, st, "Expression"); + c(node.consequent, st, "Expression"); + c(node.alternate, st, "Expression"); + }; + exports.NewExpression = exports.CallExpression = function(node, st, c) { + c(node.callee, st, "Expression"); + if (node.arguments) for (var i = 0; i < node.arguments.length; ++i) + c(node.arguments[i], st, "Expression"); + }; + exports.MemberExpression = function(node, st, c) { + c(node.object, st, "Expression"); + if (node.computed) c(node.property, st, "Expression"); + }; + exports.Identifier = exports.Literal = ignore; + + // A custom walker that keeps track of the scope chain and the + // variables defined in it. + function makeScope(prev) { + return {vars: Object.create(null), prev: prev}; + } + exports.scopeVisitor = exports.make({ + Function: function(node, scope, c) { + var inner = makeScope(scope); + for (var i = 0; i < node.params.length; ++i) + inner.vars[node.params[i].name] = {type: "argument", node: node.params[i]}; + if (node.id) { + var decl = node.type == "FunctionDeclaration"; + (decl ? scope : inner).vars[node.id.name] = + {type: decl ? "function" : "function name", node: node.id}; + } + c(node.body, inner, "ScopeBody"); + }, + TryStatement: function(node, scope, c) { + c(node.block, scope, "Statement"); + for (var i = 0; i < node.handlers.length; ++i) { + var handler = node.handlers[i], inner = makeScope(scope); + inner.vars[handler.param.name] = {type: "catch clause", node: handler.param}; + c(handler.body, inner, "ScopeBody"); + } + if (node.finalizer) c(node.finalizer, scope, "Statement"); + }, + VariableDeclaration: function(node, scope, c) { + for (var i = 0; i < node.declarations.length; ++i) { + var decl = node.declarations[i]; + scope.vars[decl.id.name] = {type: "var", node: decl.id}; + if (decl.init) c(decl.init, scope, "Expression"); + } + } + }); + +})(typeof exports == "undefined" ? acorn.walk = {} : exports); diff --git a/MixERP.Net.FrontEnd/Scripts/CodeMirror/test/mode_test.css b/MixERP.Net.FrontEnd/Scripts/CodeMirror/test/mode_test.css new file mode 100644 index 000000000..1ac66737f --- /dev/null +++ b/MixERP.Net.FrontEnd/Scripts/CodeMirror/test/mode_test.css @@ -0,0 +1,10 @@ +.mt-output .mt-token { + border: 1px solid #ddd; + white-space: pre; + font-family: "Consolas", monospace; + text-align: center; +} + +.mt-output .mt-style { + font-size: x-small; +} diff --git a/MixERP.Net.FrontEnd/Scripts/CodeMirror/test/mode_test.js b/MixERP.Net.FrontEnd/Scripts/CodeMirror/test/mode_test.js new file mode 100644 index 000000000..c759b257b --- /dev/null +++ b/MixERP.Net.FrontEnd/Scripts/CodeMirror/test/mode_test.js @@ -0,0 +1,192 @@ +/** + * Helper to test CodeMirror highlighting modes. It pretty prints output of the + * highlighter and can check against expected styles. + * + * Mode tests are registered by calling test.mode(testName, mode, + * tokens), where mode is a mode object as returned by + * CodeMirror.getMode, and tokens is an array of lines that make up + * the test. + * + * These lines are strings, in which styled stretches of code are + * enclosed in brackets `[]`, and prefixed by their style. For + * example, `[keyword if]`. Brackets in the code itself must be + * duplicated to prevent them from being interpreted as token + * boundaries. For example `a[[i]]` for `a[i]`. If a token has + * multiple styles, the styles must be separated by ampersands, for + * example `[tag&error ]`. + * + * See the test.js files in the css, markdown, gfm, and stex mode + * directories for examples. + */ +(function() { + function findSingle(str, pos, ch) { + for (;;) { + var found = str.indexOf(ch, pos); + if (found == -1) return null; + if (str.charAt(found + 1) != ch) return found; + pos = found + 2; + } + } + + var styleName = /[\w&-_]+/g; + function parseTokens(strs) { + var tokens = [], plain = ""; + for (var i = 0; i < strs.length; ++i) { + if (i) plain += "\n"; + var str = strs[i], pos = 0; + while (pos < str.length) { + var style = null, text; + if (str.charAt(pos) == "[" && str.charAt(pos+1) != "[") { + styleName.lastIndex = pos + 1; + var m = styleName.exec(str); + style = m[0].replace(/&/g, " "); + var textStart = pos + style.length + 2; + var end = findSingle(str, textStart, "]"); + if (end == null) throw new Error("Unterminated token at " + pos + " in '" + str + "'" + style); + text = str.slice(textStart, end); + pos = end + 1; + } else { + var end = findSingle(str, pos, "["); + if (end == null) end = str.length; + text = str.slice(pos, end); + pos = end; + } + text = text.replace(/\[\[|\]\]/g, function(s) {return s.charAt(0);}); + tokens.push(style, text); + plain += text; + } + } + return {tokens: tokens, plain: plain}; + } + + test.mode = function(name, mode, tokens, modeName) { + var data = parseTokens(tokens); + return test((modeName || mode.name) + "_" + name, function() { + return compare(data.plain, data.tokens, mode); + }); + }; + + function compare(text, expected, mode) { + + var expectedOutput = []; + for (var i = 0; i < expected.length; i += 2) { + var sty = expected[i]; + if (sty && sty.indexOf(" ")) sty = sty.split(' ').sort().join(' '); + expectedOutput.push(sty, expected[i + 1]); + } + + var observedOutput = highlight(text, mode); + + var pass, passStyle = ""; + pass = highlightOutputsEqual(expectedOutput, observedOutput); + passStyle = pass ? 'mt-pass' : 'mt-fail'; + + var s = ''; + if (pass) { + s += '
    '; + s += '
    ' + text.replace('&', '&').replace('<', '<') + '
    '; + s += '
    '; + s += prettyPrintOutputTable(observedOutput); + s += '
    '; + s += '
    '; + return s; + } else { + s += '
    '; + s += '
    ' + text.replace('&', '&').replace('<', '<') + '
    '; + s += '
    '; + s += 'expected:'; + s += prettyPrintOutputTable(expectedOutput); + s += 'observed:'; + s += prettyPrintOutputTable(observedOutput); + s += '
    '; + s += '
    '; + throw s; + } + } + + /** + * Emulation of CodeMirror's internal highlight routine for testing. Multi-line + * input is supported. + * + * @param string to highlight + * + * @param mode the mode that will do the actual highlighting + * + * @return array of [style, token] pairs + */ + function highlight(string, mode) { + var state = mode.startState() + + var lines = string.replace(/\r\n/g,'\n').split('\n'); + var st = [], pos = 0; + for (var i = 0; i < lines.length; ++i) { + var line = lines[i], newLine = true; + var stream = new CodeMirror.StringStream(line); + if (line == "" && mode.blankLine) mode.blankLine(state); + /* Start copied code from CodeMirror.highlight */ + while (!stream.eol()) { + var style = mode.token(stream, state), substr = stream.current(); + if (style && style.indexOf(" ") > -1) style = style.split(' ').sort().join(' '); + + stream.start = stream.pos; + if (pos && st[pos-2] == style && !newLine) { + st[pos-1] += substr; + } else if (substr) { + st[pos++] = style; st[pos++] = substr; + } + // Give up when line is ridiculously long + if (stream.pos > 5000) { + st[pos++] = null; st[pos++] = this.text.slice(stream.pos); + break; + } + newLine = false; + } + } + + return st; + } + + /** + * Compare two arrays of output from highlight. + * + * @param o1 array of [style, token] pairs + * + * @param o2 array of [style, token] pairs + * + * @return boolean; true iff outputs equal + */ + function highlightOutputsEqual(o1, o2) { + if (o1.length != o2.length) return false; + for (var i = 0; i < o1.length; ++i) + if (o1[i] != o2[i]) return false; + return true; + } + + /** + * Print tokens and corresponding styles in a table. Spaces in the token are + * replaced with 'interpunct' dots (·). + * + * @param output array of [style, token] pairs + * + * @return html string + */ + function prettyPrintOutputTable(output) { + var s = ''; + s += ''; + for (var i = 0; i < output.length; i += 2) { + var style = output[i], val = output[i+1]; + s += + ''; + } + s += ''; + for (var i = 0; i < output.length; i += 2) { + s += ''; + } + s += '
    ' + + '' + + val.replace(/ /g,'\xb7').replace('&', '&').replace('<', '<') + + '' + + '
    ' + output[i] + '
    '; + return s; + } +})(); diff --git a/MixERP.Net.FrontEnd/Scripts/CodeMirror/test/phantom_driver.js b/MixERP.Net.FrontEnd/Scripts/CodeMirror/test/phantom_driver.js new file mode 100644 index 000000000..dbad08db6 --- /dev/null +++ b/MixERP.Net.FrontEnd/Scripts/CodeMirror/test/phantom_driver.js @@ -0,0 +1,31 @@ +var page = require('webpage').create(); + +page.open("http://localhost:3000/test/index.html", function (status) { + if (status != "success") { + console.log("page couldn't be loaded successfully"); + phantom.exit(1); + } + waitFor(function () { + return page.evaluate(function () { + var output = document.getElementById('status'); + if (!output) { return false; } + return (/^(\d+ failures?|all passed)/i).test(output.innerText); + }); + }, function () { + var failed = page.evaluate(function () { return window.failed; }); + var output = page.evaluate(function () { + return document.getElementById('output').innerText + "\n" + + document.getElementById('status').innerText; + }); + console.log(output); + phantom.exit(failed > 0 ? 1 : 0); + }); +}); + +function waitFor (test, cb) { + if (test()) { + cb(); + } else { + setTimeout(function () { waitFor(test, cb); }, 250); + } +} diff --git a/MixERP.Net.FrontEnd/Scripts/CodeMirror/test/run.js b/MixERP.Net.FrontEnd/Scripts/CodeMirror/test/run.js new file mode 100644 index 000000000..52221be5a --- /dev/null +++ b/MixERP.Net.FrontEnd/Scripts/CodeMirror/test/run.js @@ -0,0 +1,34 @@ +#!/usr/bin/env node + +var lint = require("./lint/lint"); + +lint.checkDir("mode"); +lint.checkDir("lib"); +lint.checkDir("addon"); +lint.checkDir("keymap"); + +var ok = lint.success(); + +var files = new (require('node-static').Server)('.'); + +var server = require('http').createServer(function (req, res) { + req.addListener('end', function () { + files.serve(req, res); + }); +}).addListener('error', function (err) { + throw err; +}).listen(3000, function () { + var child_process = require('child_process'); + child_process.exec("which phantomjs", function (err) { + if (err) { + console.error("PhantomJS is not installed. Download from http://phantomjs.org"); + process.exit(1); + } + var cmd = 'phantomjs test/phantom_driver.js'; + child_process.exec(cmd, function (err, stdout) { + server.close(); + console.log(stdout); + process.exit(err || !ok ? 1 : 0); + }); + }); +}); diff --git a/MixERP.Net.FrontEnd/Scripts/CodeMirror/test/test.js b/MixERP.Net.FrontEnd/Scripts/CodeMirror/test/test.js new file mode 100644 index 000000000..2bcc45028 --- /dev/null +++ b/MixERP.Net.FrontEnd/Scripts/CodeMirror/test/test.js @@ -0,0 +1,1482 @@ +var Pos = CodeMirror.Pos; + +function forEach(arr, f) { + for (var i = 0, e = arr.length; i < e; ++i) f(arr[i]); +} + +function addDoc(cm, width, height) { + var content = [], line = ""; + for (var i = 0; i < width; ++i) line += "x"; + for (var i = 0; i < height; ++i) content.push(line); + cm.setValue(content.join("\n")); +} + +function byClassName(elt, cls) { + if (elt.getElementsByClassName) return elt.getElementsByClassName(cls); + var found = [], re = new RegExp("\\b" + cls + "\\b"); + function search(elt) { + if (elt.nodeType == 3) return; + if (re.test(elt.className)) found.push(elt); + for (var i = 0, e = elt.childNodes.length; i < e; ++i) + search(elt.childNodes[i]); + } + search(elt); + return found; +} + +var ie_lt8 = /MSIE [1-7]\b/.test(navigator.userAgent); +var mac = /Mac/.test(navigator.platform); +var phantom = /PhantomJS/.test(navigator.userAgent); +var opera = /Opera\/\./.test(navigator.userAgent); +var opera_version = opera && navigator.userAgent.match(/Version\/(\d+\.\d+)/); +if (opera_version) opera_version = Number(opera_version); +var opera_lt10 = opera && (!opera_version || opera_version < 10); + +namespace = "core_"; + +test("core_fromTextArea", function() { + var te = document.getElementById("code"); + te.value = "CONTENT"; + var cm = CodeMirror.fromTextArea(te); + is(!te.offsetHeight); + eq(cm.getValue(), "CONTENT"); + cm.setValue("foo\nbar"); + eq(cm.getValue(), "foo\nbar"); + cm.save(); + is(/^foo\r?\nbar$/.test(te.value)); + cm.setValue("xxx"); + cm.toTextArea(); + is(te.offsetHeight); + eq(te.value, "xxx"); +}); + +testCM("getRange", function(cm) { + eq(cm.getLine(0), "1234"); + eq(cm.getLine(1), "5678"); + eq(cm.getLine(2), null); + eq(cm.getLine(-1), null); + eq(cm.getRange(Pos(0, 0), Pos(0, 3)), "123"); + eq(cm.getRange(Pos(0, -1), Pos(0, 200)), "1234"); + eq(cm.getRange(Pos(0, 2), Pos(1, 2)), "34\n56"); + eq(cm.getRange(Pos(1, 2), Pos(100, 0)), "78"); +}, {value: "1234\n5678"}); + +testCM("replaceRange", function(cm) { + eq(cm.getValue(), ""); + cm.replaceRange("foo\n", Pos(0, 0)); + eq(cm.getValue(), "foo\n"); + cm.replaceRange("a\nb", Pos(0, 1)); + eq(cm.getValue(), "fa\nboo\n"); + eq(cm.lineCount(), 3); + cm.replaceRange("xyzzy", Pos(0, 0), Pos(1, 1)); + eq(cm.getValue(), "xyzzyoo\n"); + cm.replaceRange("abc", Pos(0, 0), Pos(10, 0)); + eq(cm.getValue(), "abc"); + eq(cm.lineCount(), 1); +}); + +testCM("selection", function(cm) { + cm.setSelection(Pos(0, 4), Pos(2, 2)); + is(cm.somethingSelected()); + eq(cm.getSelection(), "11\n222222\n33"); + eqPos(cm.getCursor(false), Pos(2, 2)); + eqPos(cm.getCursor(true), Pos(0, 4)); + cm.setSelection(Pos(1, 0)); + is(!cm.somethingSelected()); + eq(cm.getSelection(), ""); + eqPos(cm.getCursor(true), Pos(1, 0)); + cm.replaceSelection("abc"); + eq(cm.getSelection(), "abc"); + eq(cm.getValue(), "111111\nabc222222\n333333"); + cm.replaceSelection("def", "end"); + eq(cm.getSelection(), ""); + eqPos(cm.getCursor(true), Pos(1, 3)); + cm.setCursor(Pos(2, 1)); + eqPos(cm.getCursor(true), Pos(2, 1)); + cm.setCursor(1, 2); + eqPos(cm.getCursor(true), Pos(1, 2)); +}, {value: "111111\n222222\n333333"}); + +testCM("extendSelection", function(cm) { + cm.setExtending(true); + addDoc(cm, 10, 10); + cm.setSelection(Pos(3, 5)); + eqPos(cm.getCursor("head"), Pos(3, 5)); + eqPos(cm.getCursor("anchor"), Pos(3, 5)); + cm.setSelection(Pos(2, 5), Pos(5, 5)); + eqPos(cm.getCursor("head"), Pos(5, 5)); + eqPos(cm.getCursor("anchor"), Pos(2, 5)); + eqPos(cm.getCursor("start"), Pos(2, 5)); + eqPos(cm.getCursor("end"), Pos(5, 5)); + cm.setSelection(Pos(5, 5), Pos(2, 5)); + eqPos(cm.getCursor("head"), Pos(2, 5)); + eqPos(cm.getCursor("anchor"), Pos(5, 5)); + eqPos(cm.getCursor("start"), Pos(2, 5)); + eqPos(cm.getCursor("end"), Pos(5, 5)); + cm.extendSelection(Pos(3, 2)); + eqPos(cm.getCursor("head"), Pos(3, 2)); + eqPos(cm.getCursor("anchor"), Pos(5, 5)); + cm.extendSelection(Pos(6, 2)); + eqPos(cm.getCursor("head"), Pos(6, 2)); + eqPos(cm.getCursor("anchor"), Pos(5, 5)); + cm.extendSelection(Pos(6, 3), Pos(6, 4)); + eqPos(cm.getCursor("head"), Pos(6, 4)); + eqPos(cm.getCursor("anchor"), Pos(5, 5)); + cm.extendSelection(Pos(0, 3), Pos(0, 4)); + eqPos(cm.getCursor("head"), Pos(0, 3)); + eqPos(cm.getCursor("anchor"), Pos(5, 5)); + cm.extendSelection(Pos(4, 5), Pos(6, 5)); + eqPos(cm.getCursor("head"), Pos(6, 5)); + eqPos(cm.getCursor("anchor"), Pos(4, 5)); + cm.setExtending(false); + cm.extendSelection(Pos(0, 3), Pos(0, 4)); + eqPos(cm.getCursor("head"), Pos(0, 4)); + eqPos(cm.getCursor("anchor"), Pos(0, 3)); +}); + +testCM("lines", function(cm) { + eq(cm.getLine(0), "111111"); + eq(cm.getLine(1), "222222"); + eq(cm.getLine(-1), null); + cm.removeLine(1); + cm.setLine(1, "abc"); + eq(cm.getValue(), "111111\nabc"); +}, {value: "111111\n222222\n333333"}); + +testCM("indent", function(cm) { + cm.indentLine(1); + eq(cm.getLine(1), " blah();"); + cm.setOption("indentUnit", 8); + cm.indentLine(1); + eq(cm.getLine(1), "\tblah();"); + cm.setOption("indentUnit", 10); + cm.setOption("tabSize", 4); + cm.indentLine(1); + eq(cm.getLine(1), "\t\t blah();"); +}, {value: "if (x) {\nblah();\n}", indentUnit: 3, indentWithTabs: true, tabSize: 8}); + +testCM("indentByNumber", function(cm) { + cm.indentLine(0, 2); + eq(cm.getLine(0), " foo"); + cm.indentLine(0, -200); + eq(cm.getLine(0), "foo"); + cm.setSelection(Pos(0, 0), Pos(1, 2)); + cm.indentSelection(3); + eq(cm.getValue(), " foo\n bar\nbaz"); +}, {value: "foo\nbar\nbaz"}); + +test("core_defaults", function() { + var defsCopy = {}, defs = CodeMirror.defaults; + for (var opt in defs) defsCopy[opt] = defs[opt]; + defs.indentUnit = 5; + defs.value = "uu"; + defs.enterMode = "keep"; + defs.tabindex = 55; + var place = document.getElementById("testground"), cm = CodeMirror(place); + try { + eq(cm.getOption("indentUnit"), 5); + cm.setOption("indentUnit", 10); + eq(defs.indentUnit, 5); + eq(cm.getValue(), "uu"); + eq(cm.getOption("enterMode"), "keep"); + eq(cm.getInputField().tabIndex, 55); + } + finally { + for (var opt in defsCopy) defs[opt] = defsCopy[opt]; + place.removeChild(cm.getWrapperElement()); + } +}); + +testCM("lineInfo", function(cm) { + eq(cm.lineInfo(-1), null); + var mark = document.createElement("span"); + var lh = cm.setGutterMarker(1, "FOO", mark); + var info = cm.lineInfo(1); + eq(info.text, "222222"); + eq(info.gutterMarkers.FOO, mark); + eq(info.line, 1); + eq(cm.lineInfo(2).gutterMarkers, null); + cm.setGutterMarker(lh, "FOO", null); + eq(cm.lineInfo(1).gutterMarkers, null); + cm.setGutterMarker(1, "FOO", mark); + cm.setGutterMarker(0, "FOO", mark); + cm.clearGutter("FOO"); + eq(cm.lineInfo(0).gutterMarkers, null); + eq(cm.lineInfo(1).gutterMarkers, null); +}, {value: "111111\n222222\n333333"}); + +testCM("coords", function(cm) { + cm.setSize(null, 100); + addDoc(cm, 32, 200); + var top = cm.charCoords(Pos(0, 0)); + var bot = cm.charCoords(Pos(200, 30)); + is(top.left < bot.left); + is(top.top < bot.top); + is(top.top < top.bottom); + cm.scrollTo(null, 100); + var top2 = cm.charCoords(Pos(0, 0)); + is(top.top > top2.top); + eq(top.left, top2.left); +}); + +testCM("coordsChar", function(cm) { + addDoc(cm, 35, 70); + for (var i = 0; i < 2; ++i) { + var sys = i ? "local" : "page"; + for (var ch = 0; ch <= 35; ch += 5) { + for (var line = 0; line < 70; line += 5) { + cm.setCursor(line, ch); + var coords = cm.charCoords(Pos(line, ch), sys); + var pos = cm.coordsChar({left: coords.left + 1, top: coords.top + 1}, sys); + eqPos(pos, Pos(line, ch)); + } + } + } +}, {lineNumbers: true}); + +testCM("posFromIndex", function(cm) { + cm.setValue( + "This function should\n" + + "convert a zero based index\n" + + "to line and ch." + ); + + var examples = [ + { index: -1, line: 0, ch: 0 }, // <- Tests clipping + { index: 0, line: 0, ch: 0 }, + { index: 10, line: 0, ch: 10 }, + { index: 39, line: 1, ch: 18 }, + { index: 55, line: 2, ch: 7 }, + { index: 63, line: 2, ch: 15 }, + { index: 64, line: 2, ch: 15 } // <- Tests clipping + ]; + + for (var i = 0; i < examples.length; i++) { + var example = examples[i]; + var pos = cm.posFromIndex(example.index); + eq(pos.line, example.line); + eq(pos.ch, example.ch); + if (example.index >= 0 && example.index < 64) + eq(cm.indexFromPos(pos), example.index); + } +}); + +testCM("undo", function(cm) { + cm.setLine(0, "def"); + eq(cm.historySize().undo, 1); + cm.undo(); + eq(cm.getValue(), "abc"); + eq(cm.historySize().undo, 0); + eq(cm.historySize().redo, 1); + cm.redo(); + eq(cm.getValue(), "def"); + eq(cm.historySize().undo, 1); + eq(cm.historySize().redo, 0); + cm.setValue("1\n\n\n2"); + cm.clearHistory(); + eq(cm.historySize().undo, 0); + for (var i = 0; i < 20; ++i) { + cm.replaceRange("a", Pos(0, 0)); + cm.replaceRange("b", Pos(3, 0)); + } + eq(cm.historySize().undo, 40); + for (var i = 0; i < 40; ++i) + cm.undo(); + eq(cm.historySize().redo, 40); + eq(cm.getValue(), "1\n\n\n2"); +}, {value: "abc"}); + +testCM("undoDepth", function(cm) { + cm.replaceRange("d", Pos(0)); + cm.replaceRange("e", Pos(0)); + cm.replaceRange("f", Pos(0)); + cm.undo(); cm.undo(); cm.undo(); + eq(cm.getValue(), "abcd"); +}, {value: "abc", undoDepth: 2}); + +testCM("undoDoesntClearValue", function(cm) { + cm.undo(); + eq(cm.getValue(), "x"); +}, {value: "x"}); + +testCM("undoMultiLine", function(cm) { + cm.operation(function() { + cm.replaceRange("x", Pos(0, 0)); + cm.replaceRange("y", Pos(1, 0)); + }); + cm.undo(); + eq(cm.getValue(), "abc\ndef\nghi"); + cm.operation(function() { + cm.replaceRange("y", Pos(1, 0)); + cm.replaceRange("x", Pos(0, 0)); + }); + cm.undo(); + eq(cm.getValue(), "abc\ndef\nghi"); + cm.operation(function() { + cm.replaceRange("y", Pos(2, 0)); + cm.replaceRange("x", Pos(1, 0)); + cm.replaceRange("z", Pos(2, 0)); + }); + cm.undo(); + eq(cm.getValue(), "abc\ndef\nghi", 3); +}, {value: "abc\ndef\nghi"}); + +testCM("undoComposite", function(cm) { + cm.replaceRange("y", Pos(1)); + cm.operation(function() { + cm.replaceRange("x", Pos(0)); + cm.replaceRange("z", Pos(2)); + }); + eq(cm.getValue(), "ax\nby\ncz\n"); + cm.undo(); + eq(cm.getValue(), "a\nby\nc\n"); + cm.undo(); + eq(cm.getValue(), "a\nb\nc\n"); + cm.redo(); cm.redo(); + eq(cm.getValue(), "ax\nby\ncz\n"); +}, {value: "a\nb\nc\n"}); + +testCM("undoSelection", function(cm) { + cm.setSelection(Pos(0, 2), Pos(0, 4)); + cm.replaceSelection(""); + cm.setCursor(Pos(1, 0)); + cm.undo(); + eqPos(cm.getCursor(true), Pos(0, 2)); + eqPos(cm.getCursor(false), Pos(0, 4)); + cm.setCursor(Pos(1, 0)); + cm.redo(); + eqPos(cm.getCursor(true), Pos(0, 2)); + eqPos(cm.getCursor(false), Pos(0, 2)); +}, {value: "abcdefgh\n"}); + +testCM("markTextSingleLine", function(cm) { + forEach([{a: 0, b: 1, c: "", f: 2, t: 5}, + {a: 0, b: 4, c: "", f: 0, t: 2}, + {a: 1, b: 2, c: "x", f: 3, t: 6}, + {a: 4, b: 5, c: "", f: 3, t: 5}, + {a: 4, b: 5, c: "xx", f: 3, t: 7}, + {a: 2, b: 5, c: "", f: 2, t: 3}, + {a: 2, b: 5, c: "abcd", f: 6, t: 7}, + {a: 2, b: 6, c: "x", f: null, t: null}, + {a: 3, b: 6, c: "", f: null, t: null}, + {a: 0, b: 9, c: "hallo", f: null, t: null}, + {a: 4, b: 6, c: "x", f: 3, t: 4}, + {a: 4, b: 8, c: "", f: 3, t: 4}, + {a: 6, b: 6, c: "a", f: 3, t: 6}, + {a: 8, b: 9, c: "", f: 3, t: 6}], function(test) { + cm.setValue("1234567890"); + var r = cm.markText(Pos(0, 3), Pos(0, 6), {className: "foo"}); + cm.replaceRange(test.c, Pos(0, test.a), Pos(0, test.b)); + var f = r.find(); + eq(f && f.from.ch, test.f); eq(f && f.to.ch, test.t); + }); +}); + +testCM("markTextMultiLine", function(cm) { + function p(v) { return v && Pos(v[0], v[1]); } + forEach([{a: [0, 0], b: [0, 5], c: "", f: [0, 0], t: [2, 5]}, + {a: [0, 0], b: [0, 5], c: "foo\n", f: [1, 0], t: [3, 5]}, + {a: [0, 1], b: [0, 10], c: "", f: [0, 1], t: [2, 5]}, + {a: [0, 5], b: [0, 6], c: "x", f: [0, 6], t: [2, 5]}, + {a: [0, 0], b: [1, 0], c: "", f: [0, 0], t: [1, 5]}, + {a: [0, 6], b: [2, 4], c: "", f: [0, 5], t: [0, 7]}, + {a: [0, 6], b: [2, 4], c: "aa", f: [0, 5], t: [0, 9]}, + {a: [1, 2], b: [1, 8], c: "", f: [0, 5], t: [2, 5]}, + {a: [0, 5], b: [2, 5], c: "xx", f: null, t: null}, + {a: [0, 0], b: [2, 10], c: "x", f: null, t: null}, + {a: [1, 5], b: [2, 5], c: "", f: [0, 5], t: [1, 5]}, + {a: [2, 0], b: [2, 3], c: "", f: [0, 5], t: [2, 2]}, + {a: [2, 5], b: [3, 0], c: "a\nb", f: [0, 5], t: [2, 5]}, + {a: [2, 3], b: [3, 0], c: "x", f: [0, 5], t: [2, 3]}, + {a: [1, 1], b: [1, 9], c: "1\n2\n3", f: [0, 5], t: [4, 5]}], function(test) { + cm.setValue("aaaaaaaaaa\nbbbbbbbbbb\ncccccccccc\ndddddddd\n"); + var r = cm.markText(Pos(0, 5), Pos(2, 5), + {className: "CodeMirror-matchingbracket"}); + cm.replaceRange(test.c, p(test.a), p(test.b)); + var f = r.find(); + eqPos(f && f.from, p(test.f)); eqPos(f && f.to, p(test.t)); + }); +}); + +testCM("markTextUndo", function(cm) { + var marker1, marker2, bookmark; + marker1 = cm.markText(Pos(0, 1), Pos(0, 3), + {className: "CodeMirror-matchingbracket"}); + marker2 = cm.markText(Pos(0, 0), Pos(2, 1), + {className: "CodeMirror-matchingbracket"}); + bookmark = cm.setBookmark(Pos(1, 5)); + cm.operation(function(){ + cm.replaceRange("foo", Pos(0, 2)); + cm.replaceRange("bar\nbaz\nbug\n", Pos(2, 0), Pos(3, 0)); + }); + var v1 = cm.getValue(); + cm.setValue(""); + eq(marker1.find(), null); eq(marker2.find(), null); eq(bookmark.find(), null); + cm.undo(); + eqPos(bookmark.find(), Pos(1, 5), "still there"); + cm.undo(); + var m1Pos = marker1.find(), m2Pos = marker2.find(); + eqPos(m1Pos.from, Pos(0, 1)); eqPos(m1Pos.to, Pos(0, 3)); + eqPos(m2Pos.from, Pos(0, 0)); eqPos(m2Pos.to, Pos(2, 1)); + eqPos(bookmark.find(), Pos(1, 5)); + cm.redo(); cm.redo(); + eq(bookmark.find(), null); + cm.undo(); + eqPos(bookmark.find(), Pos(1, 5)); + eq(cm.getValue(), v1); +}, {value: "1234\n56789\n00\n"}); + +testCM("markTextStayGone", function(cm) { + var m1 = cm.markText(Pos(0, 0), Pos(0, 1)); + cm.replaceRange("hi", Pos(0, 2)); + m1.clear(); + cm.undo(); + eq(m1.find(), null); +}, {value: "hello"}); + +testCM("undoPreservesNewMarks", function(cm) { + cm.markText(Pos(0, 3), Pos(0, 4)); + cm.markText(Pos(1, 1), Pos(1, 3)); + cm.replaceRange("", Pos(0, 3), Pos(3, 1)); + var mBefore = cm.markText(Pos(0, 0), Pos(0, 1)); + var mAfter = cm.markText(Pos(0, 5), Pos(0, 6)); + var mAround = cm.markText(Pos(0, 2), Pos(0, 4)); + cm.undo(); + eqPos(mBefore.find().from, Pos(0, 0)); + eqPos(mBefore.find().to, Pos(0, 1)); + eqPos(mAfter.find().from, Pos(3, 3)); + eqPos(mAfter.find().to, Pos(3, 4)); + eqPos(mAround.find().from, Pos(0, 2)); + eqPos(mAround.find().to, Pos(3, 2)); + var found = cm.findMarksAt(Pos(2, 2)); + eq(found.length, 1); + eq(found[0], mAround); +}, {value: "aaaa\nbbbb\ncccc\ndddd"}); + +testCM("markClearBetween", function(cm) { + cm.setValue("aaa\nbbb\nccc\nddd\n"); + cm.markText(Pos(0, 0), Pos(2)); + cm.replaceRange("aaa\nbbb\nccc", Pos(0, 0), Pos(2)); + eq(cm.findMarksAt(Pos(1, 1)).length, 0); +}); + +testCM("deleteSpanCollapsedInclusiveLeft", function(cm) { + var from = Pos(1, 0), to = Pos(1, 1); + var m = cm.markText(from, to, {collapsed: true, inclusiveLeft: true}); + // Delete collapsed span. + cm.replaceRange("", from, to); +}, {value: "abc\nX\ndef"}); + +testCM("bookmark", function(cm) { + function p(v) { return v && Pos(v[0], v[1]); } + forEach([{a: [1, 0], b: [1, 1], c: "", d: [1, 4]}, + {a: [1, 1], b: [1, 1], c: "xx", d: [1, 7]}, + {a: [1, 4], b: [1, 5], c: "ab", d: [1, 6]}, + {a: [1, 4], b: [1, 6], c: "", d: null}, + {a: [1, 5], b: [1, 6], c: "abc", d: [1, 5]}, + {a: [1, 6], b: [1, 8], c: "", d: [1, 5]}, + {a: [1, 4], b: [1, 4], c: "\n\n", d: [3, 1]}, + {bm: [1, 9], a: [1, 1], b: [1, 1], c: "\n", d: [2, 8]}], function(test) { + cm.setValue("1234567890\n1234567890\n1234567890"); + var b = cm.setBookmark(p(test.bm) || Pos(1, 5)); + cm.replaceRange(test.c, p(test.a), p(test.b)); + eqPos(b.find(), p(test.d)); + }); +}); + +testCM("bookmarkInsertLeft", function(cm) { + var br = cm.setBookmark(Pos(0, 2), {insertLeft: false}); + var bl = cm.setBookmark(Pos(0, 2), {insertLeft: true}); + cm.setCursor(Pos(0, 2)); + cm.replaceSelection("hi"); + eqPos(br.find(), Pos(0, 2)); + eqPos(bl.find(), Pos(0, 4)); + cm.replaceRange("", Pos(0, 4), Pos(0, 5)); + cm.replaceRange("", Pos(0, 2), Pos(0, 4)); + cm.replaceRange("", Pos(0, 1), Pos(0, 2)); + // Verify that deleting next to bookmarks doesn't kill them + eqPos(br.find(), Pos(0, 1)); + eqPos(bl.find(), Pos(0, 1)); +}, {value: "abcdef"}); + +testCM("getAllMarks", function(cm) { + addDoc(cm, 10, 10); + var m1 = cm.setBookmark(Pos(0, 2)); + var m2 = cm.markText(Pos(0, 2), Pos(3, 2)); + var m3 = cm.markText(Pos(1, 2), Pos(1, 8)); + var m4 = cm.markText(Pos(8, 0), Pos(9, 0)); + eq(cm.getAllMarks().length, 4); + m1.clear(); + m3.clear(); + eq(cm.getAllMarks().length, 2); +}); + +testCM("bug577", function(cm) { + cm.setValue("a\nb"); + cm.clearHistory(); + cm.setValue("fooooo"); + cm.undo(); +}); + +testCM("scrollSnap", function(cm) { + cm.setSize(100, 100); + addDoc(cm, 200, 200); + cm.setCursor(Pos(100, 180)); + var info = cm.getScrollInfo(); + is(info.left > 0 && info.top > 0); + cm.setCursor(Pos(0, 0)); + info = cm.getScrollInfo(); + is(info.left == 0 && info.top == 0, "scrolled clean to top"); + cm.setCursor(Pos(100, 180)); + cm.setCursor(Pos(199, 0)); + info = cm.getScrollInfo(); + is(info.left == 0 && info.top + 2 > info.height - cm.getScrollerElement().clientHeight, "scrolled clean to bottom"); +}); + +testCM("scrollIntoView", function(cm) { + if (phantom) return; + var outer = cm.getWrapperElement().getBoundingClientRect(); + function test(line, ch) { + var pos = Pos(line, ch); + cm.scrollIntoView(pos); + var box = cm.charCoords(pos, "window"); + is(box.left >= outer.left && box.right <= outer.right && + box.top >= outer.top && box.bottom <= outer.bottom); + } + addDoc(cm, 200, 200); + test(199, 199); + test(0, 0); + test(100, 100); + test(199, 0); + test(0, 199); + test(100, 100); +}); + +testCM("selectionPos", function(cm) { + if (phantom) return; + cm.setSize(100, 100); + addDoc(cm, 200, 100); + cm.setSelection(Pos(1, 100), Pos(98, 100)); + var lineWidth = cm.charCoords(Pos(0, 200), "local").left; + var lineHeight = (cm.charCoords(Pos(99)).top - cm.charCoords(Pos(0)).top) / 100; + cm.scrollTo(0, 0); + var selElt = byClassName(cm.getWrapperElement(), "CodeMirror-selected"); + var outer = cm.getWrapperElement().getBoundingClientRect(); + var sawMiddle, sawTop, sawBottom; + for (var i = 0, e = selElt.length; i < e; ++i) { + var box = selElt[i].getBoundingClientRect(); + var atLeft = box.left - outer.left < 30; + var width = box.right - box.left; + var atRight = box.right - outer.left > .8 * lineWidth; + if (atLeft && atRight) { + sawMiddle = true; + is(box.bottom - box.top > 90 * lineHeight, "middle high"); + is(width > .9 * lineWidth, "middle wide"); + } else { + is(width > .4 * lineWidth, "top/bot wide enough"); + is(width < .6 * lineWidth, "top/bot slim enough"); + if (atLeft) { + sawBottom = true; + is(box.top - outer.top > 96 * lineHeight, "bot below"); + } else if (atRight) { + sawTop = true; + is(box.top - outer.top < 2.1 * lineHeight, "top above"); + } + } + } + is(sawTop && sawBottom && sawMiddle, "all parts"); +}, null); + +testCM("restoreHistory", function(cm) { + cm.setValue("abc\ndef"); + cm.setLine(1, "hello"); + cm.setLine(0, "goop"); + cm.undo(); + var storedVal = cm.getValue(), storedHist = cm.getHistory(); + if (window.JSON) storedHist = JSON.parse(JSON.stringify(storedHist)); + eq(storedVal, "abc\nhello"); + cm.setValue(""); + cm.clearHistory(); + eq(cm.historySize().undo, 0); + cm.setValue(storedVal); + cm.setHistory(storedHist); + cm.redo(); + eq(cm.getValue(), "goop\nhello"); + cm.undo(); cm.undo(); + eq(cm.getValue(), "abc\ndef"); +}); + +testCM("doubleScrollbar", function(cm) { + var dummy = document.body.appendChild(document.createElement("p")); + dummy.style.cssText = "height: 50px; overflow: scroll; width: 50px"; + var scrollbarWidth = dummy.offsetWidth + 1 - dummy.clientWidth; + document.body.removeChild(dummy); + if (scrollbarWidth < 2) return; + cm.setSize(null, 100); + addDoc(cm, 1, 300); + var wrap = cm.getWrapperElement(); + is(wrap.offsetWidth - byClassName(wrap, "CodeMirror-lines")[0].offsetWidth <= scrollbarWidth * 1.5); +}); + +testCM("weirdLinebreaks", function(cm) { + cm.setValue("foo\nbar\rbaz\r\nquux\n\rplop"); + is(cm.getValue(), "foo\nbar\nbaz\nquux\n\nplop"); + is(cm.lineCount(), 6); + cm.setValue("\n\n"); + is(cm.lineCount(), 3); +}); + +testCM("setSize", function(cm) { + cm.setSize(100, 100); + var wrap = cm.getWrapperElement(); + is(wrap.offsetWidth, 100); + is(wrap.offsetHeight, 100); + cm.setSize("100%", "3em"); + is(wrap.style.width, "100%"); + is(wrap.style.height, "3em"); + cm.setSize(null, 40); + is(wrap.style.width, "100%"); + is(wrap.style.height, "40px"); +}); + +function foldLines(cm, start, end, autoClear) { + return cm.markText(Pos(start, 0), Pos(end - 1), { + inclusiveLeft: true, + inclusiveRight: true, + collapsed: true, + clearOnEnter: autoClear + }); +} + +testCM("collapsedLines", function(cm) { + addDoc(cm, 4, 10); + var range = foldLines(cm, 4, 5), cleared = 0; + CodeMirror.on(range, "clear", function() {cleared++;}); + cm.setCursor(Pos(3, 0)); + CodeMirror.commands.goLineDown(cm); + eqPos(cm.getCursor(), Pos(5, 0)); + cm.setLine(3, "abcdefg"); + cm.setCursor(Pos(3, 6)); + CodeMirror.commands.goLineDown(cm); + eqPos(cm.getCursor(), Pos(5, 4)); + cm.setLine(3, "ab"); + cm.setCursor(Pos(3, 2)); + CodeMirror.commands.goLineDown(cm); + eqPos(cm.getCursor(), Pos(5, 2)); + cm.operation(function() {range.clear(); range.clear();}); + eq(cleared, 1); +}); + +testCM("collapsedRangeCoordsChar", function(cm) { + var pos_1_3 = cm.charCoords(Pos(1, 3)); + pos_1_3.left += 2; pos_1_3.top += 2; + var opts = {collapsed: true, inclusiveLeft: true, inclusiveRight: true}; + var m1 = cm.markText(Pos(0, 0), Pos(2, 0), opts); + eqPos(cm.coordsChar(pos_1_3), Pos(3, 3)); + m1.clear(); + var m1 = cm.markText(Pos(0, 0), Pos(1, 1), opts); + var m2 = cm.markText(Pos(1, 1), Pos(2, 0), opts); + eqPos(cm.coordsChar(pos_1_3), Pos(3, 3)); + m1.clear(); m2.clear(); + var m1 = cm.markText(Pos(0, 0), Pos(1, 6), opts); + eqPos(cm.coordsChar(pos_1_3), Pos(3, 3)); +}, {value: "123456\nabcdef\nghijkl\nmnopqr\n"}); + +testCM("hiddenLinesAutoUnfold", function(cm) { + var range = foldLines(cm, 1, 3, true), cleared = 0; + CodeMirror.on(range, "clear", function() {cleared++;}); + cm.setCursor(Pos(3, 0)); + eq(cleared, 0); + cm.execCommand("goCharLeft"); + eq(cleared, 1); + range = foldLines(cm, 1, 3, true); + CodeMirror.on(range, "clear", function() {cleared++;}); + eqPos(cm.getCursor(), Pos(3, 0)); + cm.setCursor(Pos(0, 3)); + cm.execCommand("goCharRight"); + eq(cleared, 2); +}, {value: "abc\ndef\nghi\njkl"}); + +testCM("hiddenLinesSelectAll", function(cm) { // Issue #484 + addDoc(cm, 4, 20); + foldLines(cm, 0, 10); + foldLines(cm, 11, 20); + CodeMirror.commands.selectAll(cm); + eqPos(cm.getCursor(true), Pos(10, 0)); + eqPos(cm.getCursor(false), Pos(10, 4)); +}); + + +testCM("everythingFolded", function(cm) { + addDoc(cm, 2, 2); + function enterPress() { + cm.triggerOnKeyDown({type: "keydown", keyCode: 13, preventDefault: function(){}, stopPropagation: function(){}}); + } + var fold = foldLines(cm, 0, 2); + enterPress(); + eq(cm.getValue(), "xx\nxx"); + fold.clear(); + fold = foldLines(cm, 0, 2, true); + eq(fold.find(), null); + enterPress(); + eq(cm.getValue(), "\nxx\nxx"); +}); + +testCM("structuredFold", function(cm) { + if (phantom) return; + addDoc(cm, 4, 8); + var range = cm.markText(Pos(1, 2), Pos(6, 2), { + replacedWith: document.createTextNode("Q") + }); + cm.setCursor(0, 3); + CodeMirror.commands.goLineDown(cm); + eqPos(cm.getCursor(), Pos(6, 2)); + CodeMirror.commands.goCharLeft(cm); + eqPos(cm.getCursor(), Pos(1, 2)); + CodeMirror.commands.delCharAfter(cm); + eq(cm.getValue(), "xxxx\nxxxx\nxxxx"); + addDoc(cm, 4, 8); + range = cm.markText(Pos(1, 2), Pos(6, 2), { + replacedWith: document.createTextNode("M"), + clearOnEnter: true + }); + var cleared = 0; + CodeMirror.on(range, "clear", function(){++cleared;}); + cm.setCursor(0, 3); + CodeMirror.commands.goLineDown(cm); + eqPos(cm.getCursor(), Pos(6, 2)); + CodeMirror.commands.goCharLeft(cm); + eqPos(cm.getCursor(), Pos(6, 1)); + eq(cleared, 1); + range.clear(); + eq(cleared, 1); + range = cm.markText(Pos(1, 2), Pos(6, 2), { + replacedWith: document.createTextNode("Q"), + clearOnEnter: true + }); + range.clear(); + cm.setCursor(1, 2); + CodeMirror.commands.goCharRight(cm); + eqPos(cm.getCursor(), Pos(1, 3)); + range = cm.markText(Pos(2, 0), Pos(4, 4), { + replacedWith: document.createTextNode("M") + }); + cm.setCursor(1, 0); + CodeMirror.commands.goLineDown(cm); + eqPos(cm.getCursor(), Pos(2, 0)); +}, null); + +testCM("nestedFold", function(cm) { + addDoc(cm, 10, 3); + function fold(ll, cl, lr, cr) { + return cm.markText(Pos(ll, cl), Pos(lr, cr), {collapsed: true}); + } + var inner1 = fold(0, 6, 1, 3), inner2 = fold(0, 2, 1, 8), outer = fold(0, 1, 2, 3), inner0 = fold(0, 5, 0, 6); + cm.setCursor(0, 1); + CodeMirror.commands.goCharRight(cm); + eqPos(cm.getCursor(), Pos(2, 3)); + inner0.clear(); + CodeMirror.commands.goCharLeft(cm); + eqPos(cm.getCursor(), Pos(0, 1)); + outer.clear(); + CodeMirror.commands.goCharRight(cm); + eqPos(cm.getCursor(), Pos(0, 2)); + CodeMirror.commands.goCharRight(cm); + eqPos(cm.getCursor(), Pos(1, 8)); + inner2.clear(); + CodeMirror.commands.goCharLeft(cm); + eqPos(cm.getCursor(), Pos(1, 7)); + cm.setCursor(0, 5); + CodeMirror.commands.goCharRight(cm); + eqPos(cm.getCursor(), Pos(0, 6)); + CodeMirror.commands.goCharRight(cm); + eqPos(cm.getCursor(), Pos(1, 3)); +}); + +testCM("badNestedFold", function(cm) { + addDoc(cm, 4, 4); + cm.markText(Pos(0, 2), Pos(3, 2), {collapsed: true}); + var caught; + try {cm.markText(Pos(0, 1), Pos(0, 3), {collapsed: true});} + catch(e) {caught = e;} + is(caught instanceof Error, "no error"); + is(/overlap/i.test(caught.message), "wrong error"); +}); + +testCM("wrappingInlineWidget", function(cm) { + cm.setSize("11em"); + var w = document.createElement("span"); + w.style.color = "red"; + w.innerHTML = "one two three four"; + cm.markText(Pos(0, 6), Pos(0, 9), {replacedWith: w}); + var cur0 = cm.cursorCoords(Pos(0, 0)), cur1 = cm.cursorCoords(Pos(0, 10)); + is(cur0.top < cur1.top); + is(cur0.bottom < cur1.bottom); + var curL = cm.cursorCoords(Pos(0, 6)), curR = cm.cursorCoords(Pos(0, 9)); + eq(curL.top, cur0.top); + eq(curL.bottom, cur0.bottom); + eq(curR.top, cur1.top); + eq(curR.bottom, cur1.bottom); + cm.replaceRange("", Pos(0, 9), Pos(0)); + curR = cm.cursorCoords(Pos(0, 9)); + eq(curR.top, cur1.top); + eq(curR.bottom, cur1.bottom); +}, {value: "1 2 3 xxx 4", lineWrapping: true}); + +testCM("inlineWidget", function(cm) { + var w = cm.setBookmark(Pos(0, 2), {widget: document.createTextNode("uu")}); + cm.setCursor(0, 2); + CodeMirror.commands.goLineDown(cm); + eqPos(cm.getCursor(), Pos(1, 4)); + cm.setCursor(0, 2); + cm.replaceSelection("hi"); + eqPos(w.find(), Pos(0, 2)); + cm.setCursor(0, 1); + cm.replaceSelection("ay"); + eqPos(w.find(), Pos(0, 4)); + eq(cm.getLine(0), "uayuhiuu"); +}, {value: "uuuu\nuuuuuu"}); + +testCM("wrappingAndResizing", function(cm) { + cm.setSize(null, "auto"); + cm.setOption("lineWrapping", true); + var wrap = cm.getWrapperElement(), h0 = wrap.offsetHeight; + var doc = "xxx xxx xxx xxx xxx"; + cm.setValue(doc); + for (var step = 10, w = cm.charCoords(Pos(0, 18), "div").right;; w += step) { + cm.setSize(w); + if (wrap.offsetHeight <= h0 * (opera_lt10 ? 1.2 : 1.5)) { + if (step == 10) { w -= 10; step = 1; } + else break; + } + } + // Ensure that putting the cursor at the end of the maximally long + // line doesn't cause wrapping to happen. + cm.setCursor(Pos(0, doc.length)); + eq(wrap.offsetHeight, h0); + cm.replaceSelection("x"); + is(wrap.offsetHeight > h0, "wrapping happens"); + // Now add a max-height and, in a document consisting of + // almost-wrapped lines, go over it so that a scrollbar appears. + cm.setValue(doc + "\n" + doc + "\n"); + cm.getScrollerElement().style.maxHeight = "100px"; + cm.replaceRange("\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n!\n", Pos(2, 0)); + forEach([Pos(0, doc.length), Pos(0, doc.length - 1), + Pos(0, 0), Pos(1, doc.length), Pos(1, doc.length - 1)], + function(pos) { + var coords = cm.charCoords(pos); + eqPos(pos, cm.coordsChar({left: coords.left + 2, top: coords.top + 5})); + }); +}, null, ie_lt8); + +testCM("measureEndOfLine", function(cm) { + cm.setSize(null, "auto"); + var inner = byClassName(cm.getWrapperElement(), "CodeMirror-lines")[0].firstChild; + var lh = inner.offsetHeight; + for (var step = 10, w = cm.charCoords(Pos(0, 7), "div").right;; w += step) { + cm.setSize(w); + if (inner.offsetHeight < 2.5 * lh) { + if (step == 10) { w -= 10; step = 1; } + else break; + } + } + cm.setValue(cm.getValue() + "\n\n"); + var endPos = cm.charCoords(Pos(0, 18), "local"); + is(endPos.top > lh * .8, "not at top"); + is(endPos.left > w - 20, "not at right"); + endPos = cm.charCoords(Pos(0, 18)); + eqPos(cm.coordsChar({left: endPos.left, top: endPos.top + 5}), Pos(0, 18)); +}, {mode: "text/html", value: "", lineWrapping: true}, ie_lt8 || opera_lt10); + +testCM("scrollVerticallyAndHorizontally", function(cm) { + cm.setSize(100, 100); + addDoc(cm, 40, 40); + cm.setCursor(39); + var wrap = cm.getWrapperElement(), bar = byClassName(wrap, "CodeMirror-vscrollbar")[0]; + is(bar.offsetHeight < wrap.offsetHeight, "vertical scrollbar limited by horizontal one"); + var cursorBox = byClassName(wrap, "CodeMirror-cursor")[0].getBoundingClientRect(); + var editorBox = wrap.getBoundingClientRect(); + is(cursorBox.bottom < editorBox.top + cm.getScrollerElement().clientHeight, + "bottom line visible"); +}, {lineNumbers: true}); + +testCM("moveVstuck", function(cm) { + var lines = byClassName(cm.getWrapperElement(), "CodeMirror-lines")[0].firstChild, h0 = lines.offsetHeight; + var val = "fooooooooooooooooooooooooo baaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaar\n"; + cm.setValue(val); + for (var w = cm.charCoords(Pos(0, 26), "div").right * 2.8;; w += 5) { + cm.setSize(w); + if (lines.offsetHeight <= 3.5 * h0) break; + } + cm.setCursor(Pos(0, val.length - 1)); + cm.moveV(-1, "line"); + eqPos(cm.getCursor(), Pos(0, 26)); +}, {lineWrapping: true}, ie_lt8 || opera_lt10); + +testCM("clickTab", function(cm) { + var p0 = cm.charCoords(Pos(0, 0)); + eqPos(cm.coordsChar({left: p0.left + 5, top: p0.top + 5}), Pos(0, 0)); + eqPos(cm.coordsChar({left: p0.right - 5, top: p0.top + 5}), Pos(0, 1)); +}, {value: "\t\n\n", lineWrapping: true, tabSize: 8}); + +testCM("verticalScroll", function(cm) { + cm.setSize(100, 200); + cm.setValue("foo\nbar\nbaz\n"); + var sc = cm.getScrollerElement(), baseWidth = sc.scrollWidth; + cm.setLine(0, "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaah"); + is(sc.scrollWidth > baseWidth, "scrollbar present"); + cm.setLine(0, "foo"); + if (!phantom) eq(sc.scrollWidth, baseWidth, "scrollbar gone"); + cm.setLine(0, "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaah"); + cm.setLine(1, "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbh"); + is(sc.scrollWidth > baseWidth, "present again"); + var curWidth = sc.scrollWidth; + cm.setLine(0, "foo"); + is(sc.scrollWidth < curWidth, "scrollbar smaller"); + is(sc.scrollWidth > baseWidth, "but still present"); +}); + +testCM("extraKeys", function(cm) { + var outcome; + function fakeKey(expected, code, props) { + if (typeof code == "string") code = code.charCodeAt(0); + var e = {type: "keydown", keyCode: code, preventDefault: function(){}, stopPropagation: function(){}}; + if (props) for (var n in props) e[n] = props[n]; + outcome = null; + cm.triggerOnKeyDown(e); + eq(outcome, expected); + } + CodeMirror.commands.testCommand = function() {outcome = "tc";}; + CodeMirror.commands.goTestCommand = function() {outcome = "gtc";}; + cm.setOption("extraKeys", {"Shift-X": function() {outcome = "sx";}, + "X": function() {outcome = "x";}, + "Ctrl-Alt-U": function() {outcome = "cau";}, + "End": "testCommand", + "Home": "goTestCommand", + "Tab": false}); + fakeKey(null, "U"); + fakeKey("cau", "U", {ctrlKey: true, altKey: true}); + fakeKey(null, "U", {shiftKey: true, ctrlKey: true, altKey: true}); + fakeKey("x", "X"); + fakeKey("sx", "X", {shiftKey: true}); + fakeKey("tc", 35); + fakeKey(null, 35, {shiftKey: true}); + fakeKey("gtc", 36); + fakeKey("gtc", 36, {shiftKey: true}); + fakeKey(null, 9); +}, null, window.opera && mac); + +testCM("wordMovementCommands", function(cm) { + cm.execCommand("goWordLeft"); + eqPos(cm.getCursor(), Pos(0, 0)); + cm.execCommand("goWordRight"); cm.execCommand("goWordRight"); + eqPos(cm.getCursor(), Pos(0, 7)); + cm.execCommand("goWordLeft"); + eqPos(cm.getCursor(), Pos(0, 5)); + cm.execCommand("goWordRight"); cm.execCommand("goWordRight"); + eqPos(cm.getCursor(), Pos(0, 12)); + cm.execCommand("goWordLeft"); + eqPos(cm.getCursor(), Pos(0, 9)); + cm.execCommand("goWordRight"); cm.execCommand("goWordRight"); cm.execCommand("goWordRight"); + eqPos(cm.getCursor(), Pos(0, 24)); + cm.execCommand("goWordRight"); cm.execCommand("goWordRight"); + eqPos(cm.getCursor(), Pos(1, 9)); + cm.execCommand("goWordRight"); + eqPos(cm.getCursor(), Pos(1, 13)); + cm.execCommand("goWordRight"); cm.execCommand("goWordRight"); + eqPos(cm.getCursor(), Pos(2, 0)); +}, {value: "this is (the) firstline.\na foo12\u00e9\u00f8\u00d7bar\n"}); + +testCM("groupMovementCommands", function(cm) { + cm.execCommand("goGroupLeft"); + eqPos(cm.getCursor(), Pos(0, 0)); + cm.execCommand("goGroupRight"); + eqPos(cm.getCursor(), Pos(0, 4)); + cm.execCommand("goGroupRight"); + eqPos(cm.getCursor(), Pos(0, 7)); + cm.execCommand("goGroupRight"); + eqPos(cm.getCursor(), Pos(0, 10)); + cm.execCommand("goGroupLeft"); + eqPos(cm.getCursor(), Pos(0, 7)); + cm.execCommand("goGroupRight"); cm.execCommand("goGroupRight"); cm.execCommand("goGroupRight"); + eqPos(cm.getCursor(), Pos(0, 15)); + cm.setCursor(Pos(0, 17)); + cm.execCommand("goGroupLeft"); + eqPos(cm.getCursor(), Pos(0, 16)); + cm.execCommand("goGroupLeft"); + eqPos(cm.getCursor(), Pos(0, 14)); + cm.execCommand("goGroupRight"); cm.execCommand("goGroupRight"); + eqPos(cm.getCursor(), Pos(0, 20)); + cm.execCommand("goGroupRight"); + eqPos(cm.getCursor(), Pos(1, 5)); + cm.execCommand("goGroupLeft"); cm.execCommand("goGroupLeft"); + eqPos(cm.getCursor(), Pos(1, 0)); + cm.execCommand("goGroupLeft"); + eqPos(cm.getCursor(), Pos(0, 16)); +}, {value: "booo ba---quux. ffff\n abc d"}); + +testCM("charMovementCommands", function(cm) { + cm.execCommand("goCharLeft"); cm.execCommand("goColumnLeft"); + eqPos(cm.getCursor(), Pos(0, 0)); + cm.execCommand("goCharRight"); cm.execCommand("goCharRight"); + eqPos(cm.getCursor(), Pos(0, 2)); + cm.setCursor(Pos(1, 0)); + cm.execCommand("goColumnLeft"); + eqPos(cm.getCursor(), Pos(1, 0)); + cm.execCommand("goCharLeft"); + eqPos(cm.getCursor(), Pos(0, 5)); + cm.execCommand("goColumnRight"); + eqPos(cm.getCursor(), Pos(0, 5)); + cm.execCommand("goCharRight"); + eqPos(cm.getCursor(), Pos(1, 0)); + cm.execCommand("goLineEnd"); + eqPos(cm.getCursor(), Pos(1, 5)); + cm.execCommand("goLineStartSmart"); + eqPos(cm.getCursor(), Pos(1, 1)); + cm.execCommand("goLineStartSmart"); + eqPos(cm.getCursor(), Pos(1, 0)); + cm.setCursor(Pos(2, 0)); + cm.execCommand("goCharRight"); cm.execCommand("goColumnRight"); + eqPos(cm.getCursor(), Pos(2, 0)); +}, {value: "line1\n ine2\n"}); + +testCM("verticalMovementCommands", function(cm) { + cm.execCommand("goLineUp"); + eqPos(cm.getCursor(), Pos(0, 0)); + cm.execCommand("goLineDown"); + if (!phantom) // This fails in PhantomJS, though not in a real Webkit + eqPos(cm.getCursor(), Pos(1, 0)); + cm.setCursor(Pos(1, 12)); + cm.execCommand("goLineDown"); + eqPos(cm.getCursor(), Pos(2, 5)); + cm.execCommand("goLineDown"); + eqPos(cm.getCursor(), Pos(3, 0)); + cm.execCommand("goLineUp"); + eqPos(cm.getCursor(), Pos(2, 5)); + cm.execCommand("goLineUp"); + eqPos(cm.getCursor(), Pos(1, 12)); + cm.execCommand("goPageDown"); + eqPos(cm.getCursor(), Pos(5, 0)); + cm.execCommand("goPageDown"); cm.execCommand("goLineDown"); + eqPos(cm.getCursor(), Pos(5, 0)); + cm.execCommand("goPageUp"); + eqPos(cm.getCursor(), Pos(0, 0)); +}, {value: "line1\nlong long line2\nline3\n\nline5\n"}); + +testCM("verticalMovementCommandsWrapping", function(cm) { + cm.setSize(120); + cm.setCursor(Pos(0, 5)); + cm.execCommand("goLineDown"); + eq(cm.getCursor().line, 0); + is(cm.getCursor().ch > 5, "moved beyond wrap"); + for (var i = 0; ; ++i) { + is(i < 20, "no endless loop"); + cm.execCommand("goLineDown"); + var cur = cm.getCursor(); + if (cur.line == 1) eq(cur.ch, 5); + if (cur.line == 2) { eq(cur.ch, 1); break; } + } +}, {value: "a very long line that wraps around somehow so that we can test cursor movement\nshortone\nk", + lineWrapping: true}); + +testCM("rtlMovement", function(cm) { + forEach(["خحج", "خحabcخحج", "abخحخحجcd", "abخde", "abخح2342خ1حج", "خ1ح2خح3حxج", + "خحcd", "1خحcd", "abcdeح1ج", "خمرحبها مها!", "foobarر", + ""], function(line) { + var inv = line.charAt(0) == "خ"; + cm.setValue(line + "\n"); cm.execCommand(inv ? "goLineEnd" : "goLineStart"); + var cursor = byClassName(cm.getWrapperElement(), "CodeMirror-cursor")[0]; + var prevX = cursor.offsetLeft, prevY = cursor.offsetTop; + for (var i = 0; i <= line.length; ++i) { + cm.execCommand("goCharRight"); + if (i == line.length) is(cursor.offsetTop > prevY, "next line"); + else is(cursor.offsetLeft > prevX, "moved right"); + prevX = cursor.offsetLeft; prevY = cursor.offsetTop; + } + cm.setCursor(0, 0); cm.execCommand(inv ? "goLineStart" : "goLineEnd"); + prevX = cursor.offsetLeft; + for (var i = 0; i < line.length; ++i) { + cm.execCommand("goCharLeft"); + is(cursor.offsetLeft < prevX, "moved left"); + prevX = cursor.offsetLeft; + } + }); +}, {rtlMoveVisually: true}); + +// Verify that updating a line clears its bidi ordering +testCM("bidiUpdate", function(cm) { + cm.setCursor(Pos(0, 2)); + cm.replaceSelection("خحج", "start"); + cm.execCommand("goCharRight"); + eqPos(cm.getCursor(), Pos(0, 4)); +}, {value: "abcd\n"}); + +testCM("movebyTextUnit", function(cm) { + cm.setValue("בְּרֵאשִ\ńéée\n"); + cm.execCommand("goLineEnd"); + for (var i = 0; i < 4; ++i) cm.execCommand("goCharRight"); + eqPos(cm.getCursor(), Pos(0, 0)); + cm.execCommand("goCharRight"); + eqPos(cm.getCursor(), Pos(1, 0)); + cm.execCommand("goCharRight"); + cm.execCommand("goCharRight"); + eqPos(cm.getCursor(), Pos(1, 3)); + cm.execCommand("goCharRight"); + cm.execCommand("goCharRight"); + eqPos(cm.getCursor(), Pos(1, 6)); +}); + +testCM("lineChangeEvents", function(cm) { + addDoc(cm, 3, 5); + var log = [], want = ["ch 0", "ch 1", "del 2", "ch 0", "ch 0", "del 1", "del 3", "del 4"]; + for (var i = 0; i < 5; ++i) { + CodeMirror.on(cm.getLineHandle(i), "delete", function(i) { + return function() {log.push("del " + i);}; + }(i)); + CodeMirror.on(cm.getLineHandle(i), "change", function(i) { + return function() {log.push("ch " + i);}; + }(i)); + } + cm.replaceRange("x", Pos(0, 1)); + cm.replaceRange("xy", Pos(1, 1), Pos(2)); + cm.replaceRange("foo\nbar", Pos(0, 1)); + cm.replaceRange("", Pos(0, 0), Pos(cm.lineCount())); + eq(log.length, want.length, "same length"); + for (var i = 0; i < log.length; ++i) + eq(log[i], want[i]); +}); + +testCM("scrollEntirelyToRight", function(cm) { + if (phantom) return; + addDoc(cm, 500, 2); + cm.setCursor(Pos(0, 500)); + var wrap = cm.getWrapperElement(), cur = byClassName(wrap, "CodeMirror-cursor")[0]; + is(wrap.getBoundingClientRect().right > cur.getBoundingClientRect().left); +}); + +testCM("lineWidgets", function(cm) { + addDoc(cm, 500, 3); + var last = cm.charCoords(Pos(2, 0)); + var node = document.createElement("div"); + node.innerHTML = "hi"; + var widget = cm.addLineWidget(1, node); + is(last.top < cm.charCoords(Pos(2, 0)).top, "took up space"); + cm.setCursor(Pos(1, 1)); + cm.execCommand("goLineDown"); + eqPos(cm.getCursor(), Pos(2, 1)); + cm.execCommand("goLineUp"); + eqPos(cm.getCursor(), Pos(1, 1)); +}); + +testCM("lineWidgetFocus", function(cm) { + var place = document.getElementById("testground"); + place.className = "offscreen"; + try { + addDoc(cm, 500, 10); + var node = document.createElement("input"); + var widget = cm.addLineWidget(1, node); + node.focus(); + eq(document.activeElement, node); + cm.replaceRange("new stuff", Pos(1, 0)); + eq(document.activeElement, node); + } finally { + place.className = ""; + } +}); + +testCM("getLineNumber", function(cm) { + addDoc(cm, 2, 20); + var h1 = cm.getLineHandle(1); + eq(cm.getLineNumber(h1), 1); + cm.replaceRange("hi\nbye\n", Pos(0, 0)); + eq(cm.getLineNumber(h1), 3); + cm.setValue(""); + eq(cm.getLineNumber(h1), null); +}); + +testCM("jumpTheGap", function(cm) { + var longLine = "abcdef ghiklmnop qrstuvw xyz "; + longLine += longLine; longLine += longLine; longLine += longLine; + cm.setLine(2, longLine); + cm.setSize("200px", null); + cm.getWrapperElement().style.lineHeight = 2; + cm.refresh(); + cm.setCursor(Pos(0, 1)); + cm.execCommand("goLineDown"); + eqPos(cm.getCursor(), Pos(1, 1)); + cm.execCommand("goLineDown"); + eqPos(cm.getCursor(), Pos(2, 1)); + cm.execCommand("goLineDown"); + eq(cm.getCursor().line, 2); + is(cm.getCursor().ch > 1); + cm.execCommand("goLineUp"); + eqPos(cm.getCursor(), Pos(2, 1)); + cm.execCommand("goLineUp"); + eqPos(cm.getCursor(), Pos(1, 1)); + var node = document.createElement("div"); + node.innerHTML = "hi"; node.style.height = "30px"; + cm.addLineWidget(0, node); + cm.addLineWidget(1, node.cloneNode(true), {above: true}); + cm.setCursor(Pos(0, 2)); + cm.execCommand("goLineDown"); + eqPos(cm.getCursor(), Pos(1, 2)); + cm.execCommand("goLineUp"); + eqPos(cm.getCursor(), Pos(0, 2)); +}, {lineWrapping: true, value: "abc\ndef\nghi\njkl\n"}); + +testCM("addLineClass", function(cm) { + function cls(line, text, bg, wrap) { + var i = cm.lineInfo(line); + eq(i.textClass, text); + eq(i.bgClass, bg); + eq(i.wrapClass, wrap); + } + cm.addLineClass(0, "text", "foo"); + cm.addLineClass(0, "text", "bar"); + cm.addLineClass(1, "background", "baz"); + cm.addLineClass(1, "wrap", "foo"); + cls(0, "foo bar", null, null); + cls(1, null, "baz", "foo"); + var lines = cm.display.lineDiv; + eq(byClassName(lines, "foo").length, 2); + eq(byClassName(lines, "bar").length, 1); + eq(byClassName(lines, "baz").length, 1); + cm.removeLineClass(0, "text", "foo"); + cls(0, "bar", null, null); + cm.removeLineClass(0, "text", "foo"); + cls(0, "bar", null, null); + cm.removeLineClass(0, "text", "bar"); + cls(0, null, null, null); + cm.addLineClass(1, "wrap", "quux"); + cls(1, null, "baz", "foo quux"); + cm.removeLineClass(1, "wrap"); + cls(1, null, "baz", null); +}, {value: "hohoho\n"}); + +testCM("atomicMarker", function(cm) { + addDoc(cm, 10, 10); + function atom(ll, cl, lr, cr, li, ri) { + return cm.markText(Pos(ll, cl), Pos(lr, cr), + {atomic: true, inclusiveLeft: li, inclusiveRight: ri}); + } + var m = atom(0, 1, 0, 5); + cm.setCursor(Pos(0, 1)); + cm.execCommand("goCharRight"); + eqPos(cm.getCursor(), Pos(0, 5)); + cm.execCommand("goCharLeft"); + eqPos(cm.getCursor(), Pos(0, 1)); + m.clear(); + m = atom(0, 0, 0, 5, true); + eqPos(cm.getCursor(), Pos(0, 5), "pushed out"); + cm.execCommand("goCharLeft"); + eqPos(cm.getCursor(), Pos(0, 5)); + m.clear(); + m = atom(8, 4, 9, 10, false, true); + cm.setCursor(Pos(9, 8)); + eqPos(cm.getCursor(), Pos(8, 4), "set"); + cm.execCommand("goCharRight"); + eqPos(cm.getCursor(), Pos(8, 4), "char right"); + cm.execCommand("goLineDown"); + eqPos(cm.getCursor(), Pos(8, 4), "line down"); + cm.execCommand("goCharLeft"); + eqPos(cm.getCursor(), Pos(8, 3)); + m.clear(); + m = atom(1, 1, 3, 8); + cm.setCursor(Pos(2, 0)); + eqPos(cm.getCursor(), Pos(3, 8)); + cm.execCommand("goCharLeft"); + eqPos(cm.getCursor(), Pos(1, 1)); + cm.execCommand("goCharRight"); + eqPos(cm.getCursor(), Pos(3, 8)); + cm.execCommand("goLineUp"); + eqPos(cm.getCursor(), Pos(1, 1)); + cm.execCommand("goLineDown"); + eqPos(cm.getCursor(), Pos(3, 8)); + cm.execCommand("delCharBefore"); + eq(cm.getValue().length, 80, "del chunk"); + m = atom(3, 0, 5, 5); + cm.setCursor(Pos(3, 0)); + cm.execCommand("delWordAfter"); + eq(cm.getValue().length, 53, "del chunk"); +}); + +testCM("readOnlyMarker", function(cm) { + function mark(ll, cl, lr, cr, at) { + return cm.markText(Pos(ll, cl), Pos(lr, cr), + {readOnly: true, atomic: at}); + } + var m = mark(0, 1, 0, 4); + cm.setCursor(Pos(0, 2)); + cm.replaceSelection("hi", "end"); + eqPos(cm.getCursor(), Pos(0, 2)); + eq(cm.getLine(0), "abcde"); + cm.execCommand("selectAll"); + cm.replaceSelection("oops"); + eq(cm.getValue(), "oopsbcd"); + cm.undo(); + eqPos(m.find().from, Pos(0, 1)); + eqPos(m.find().to, Pos(0, 4)); + m.clear(); + cm.setCursor(Pos(0, 2)); + cm.replaceSelection("hi"); + eq(cm.getLine(0), "abhicde"); + eqPos(cm.getCursor(), Pos(0, 4)); + m = mark(0, 2, 2, 2, true); + cm.setSelection(Pos(1, 1), Pos(2, 4)); + cm.replaceSelection("t", "end"); + eqPos(cm.getCursor(), Pos(2, 3)); + eq(cm.getLine(2), "klto"); + cm.execCommand("goCharLeft"); + cm.execCommand("goCharLeft"); + eqPos(cm.getCursor(), Pos(0, 2)); + cm.setSelection(Pos(0, 1), Pos(0, 3)); + cm.replaceSelection("xx"); + eqPos(cm.getCursor(), Pos(0, 3)); + eq(cm.getLine(0), "axxhicde"); +}, {value: "abcde\nfghij\nklmno\n"}); + +testCM("dirtyBit", function(cm) { + eq(cm.isClean(), true); + cm.replaceSelection("boo"); + eq(cm.isClean(), false); + cm.undo(); + eq(cm.isClean(), true); + cm.replaceSelection("boo"); + cm.replaceSelection("baz"); + cm.undo(); + eq(cm.isClean(), false); + cm.markClean(); + eq(cm.isClean(), true); + cm.undo(); + eq(cm.isClean(), false); + cm.redo(); + eq(cm.isClean(), true); +}); + +testCM("addKeyMap", function(cm) { + function sendKey(code) { + cm.triggerOnKeyDown({type: "keydown", keyCode: code, + preventDefault: function(){}, stopPropagation: function(){}}); + } + + sendKey(39); + eqPos(cm.getCursor(), Pos(0, 1)); + var test = 0; + var map1 = {Right: function() { ++test; }}, map2 = {Right: function() { test += 10; }} + cm.addKeyMap(map1); + sendKey(39); + eqPos(cm.getCursor(), Pos(0, 1)); + eq(test, 1); + cm.addKeyMap(map2, true); + sendKey(39); + eq(test, 2); + cm.removeKeyMap(map1); + sendKey(39); + eq(test, 12); + cm.removeKeyMap(map2); + sendKey(39); + eq(test, 12); + eqPos(cm.getCursor(), Pos(0, 2)); + cm.addKeyMap({Right: function() { test = 55; }, name: "mymap"}); + sendKey(39); + eq(test, 55); + cm.removeKeyMap("mymap"); + sendKey(39); + eqPos(cm.getCursor(), Pos(0, 3)); +}, {value: "abc"}); + +testCM("findPosH", function(cm) { + forEach([{from: Pos(0, 0), to: Pos(0, 1), by: 1}, + {from: Pos(0, 0), to: Pos(0, 0), by: -1, hitSide: true}, + {from: Pos(0, 0), to: Pos(0, 4), by: 1, unit: "word"}, + {from: Pos(0, 0), to: Pos(0, 8), by: 2, unit: "word"}, + {from: Pos(0, 0), to: Pos(2, 0), by: 20, unit: "word", hitSide: true}, + {from: Pos(0, 7), to: Pos(0, 5), by: -1, unit: "word"}, + {from: Pos(0, 4), to: Pos(0, 8), by: 1, unit: "word"}, + {from: Pos(1, 0), to: Pos(1, 18), by: 3, unit: "word"}, + {from: Pos(1, 22), to: Pos(1, 5), by: -3, unit: "word"}, + {from: Pos(1, 15), to: Pos(1, 10), by: -5}, + {from: Pos(1, 15), to: Pos(1, 10), by: -5, unit: "column"}, + {from: Pos(1, 15), to: Pos(1, 0), by: -50, unit: "column", hitSide: true}, + {from: Pos(1, 15), to: Pos(1, 24), by: 50, unit: "column", hitSide: true}, + {from: Pos(1, 15), to: Pos(2, 0), by: 50, hitSide: true}], function(t) { + var r = cm.findPosH(t.from, t.by, t.unit || "char"); + eqPos(r, t.to); + eq(!!r.hitSide, !!t.hitSide); + }); +}, {value: "line one\nline two.something.other\n"}); + +testCM("beforeChange", function(cm) { + cm.on("beforeChange", function(cm, change) { + var text = []; + for (var i = 0; i < change.text.length; ++i) + text.push(change.text[i].replace(/\s/g, "_")); + change.update(null, null, text); + }); + cm.setValue("hello, i am a\nnew document\n"); + eq(cm.getValue(), "hello,_i_am_a\nnew_document\n"); + CodeMirror.on(cm.getDoc(), "beforeChange", function(doc, change) { + if (change.from.line == 0) change.cancel(); + }); + cm.setValue("oops"); // Canceled + eq(cm.getValue(), "hello,_i_am_a\nnew_document\n"); + cm.replaceRange("hey hey hey", Pos(1, 0), Pos(2, 0)); + eq(cm.getValue(), "hello,_i_am_a\nhey_hey_hey"); +}, {value: "abcdefghijk"}); + +testCM("beforeChangeUndo", function(cm) { + cm.setLine(0, "hi"); + cm.setLine(0, "bye"); + eq(cm.historySize().undo, 2); + cm.on("beforeChange", function(cm, change) { + is(!change.update); + change.cancel(); + }); + cm.undo(); + eq(cm.historySize().undo, 0); + eq(cm.getValue(), "bye\ntwo"); +}, {value: "one\ntwo"}); + +testCM("beforeSelectionChange", function(cm) { + function notAtEnd(cm, pos) { + var len = cm.getLine(pos.line).length; + if (!len || pos.ch == len) return Pos(pos.line, pos.ch - 1); + return pos; + } + cm.on("beforeSelectionChange", function(cm, sel) { + sel.head = notAtEnd(cm, sel.head); + sel.anchor = notAtEnd(cm, sel.anchor); + }); + + addDoc(cm, 10, 10); + cm.execCommand("goLineEnd"); + eqPos(cm.getCursor(), Pos(0, 9)); + cm.execCommand("selectAll"); + eqPos(cm.getCursor("start"), Pos(0, 0)); + eqPos(cm.getCursor("end"), Pos(9, 9)); +}); + +testCM("change_removedText", function(cm) { + cm.setValue("abc\ndef"); + + var removedText; + cm.on("change", function(cm, change) { + removedText = [change.removed, change.next && change.next.removed]; + }); + + cm.operation(function() { + cm.replaceRange("xyz", Pos(0, 0), Pos(1,1)); + cm.replaceRange("123", Pos(0,0)); + }); + + eq(removedText[0].join("\n"), "abc\nd"); + eq(removedText[1].join("\n"), ""); + + cm.undo(); + eq(removedText[0].join("\n"), "123"); + eq(removedText[1].join("\n"), "xyz"); + + cm.redo(); + eq(removedText[0].join("\n"), "abc\nd"); + eq(removedText[1].join("\n"), ""); +}); diff --git a/MixERP.Net.FrontEnd/Scripts/CodeMirror/test/vim_test.js b/MixERP.Net.FrontEnd/Scripts/CodeMirror/test/vim_test.js new file mode 100644 index 000000000..47fc6cd14 --- /dev/null +++ b/MixERP.Net.FrontEnd/Scripts/CodeMirror/test/vim_test.js @@ -0,0 +1,2348 @@ +var code = '' + +' wOrd1 (#%\n' + +' word3] \n' + +'aopop pop 0 1 2 3 4\n' + +' (a) [b] {c} \n' + +'int getchar(void) {\n' + +' static char buf[BUFSIZ];\n' + +' static char *bufp = buf;\n' + +' if (n == 0) { /* buffer is empty */\n' + +' n = read(0, buf, sizeof buf);\n' + +' bufp = buf;\n' + +' }\n' + +'\n' + +' return (--n >= 0) ? (unsigned char) *bufp++ : EOF;\n' + +' \n' + +'}\n'; + +var lines = (function() { + lineText = code.split('\n'); + var ret = []; + for (var i = 0; i < lineText.length; i++) { + ret[i] = { + line: i, + length: lineText[i].length, + lineText: lineText[i], + textStart: /^\s*/.exec(lineText[i])[0].length + }; + } + return ret; +})(); +var endOfDocument = makeCursor(lines.length - 1, + lines[lines.length - 1].length); +var wordLine = lines[0]; +var bigWordLine = lines[1]; +var charLine = lines[2]; +var bracesLine = lines[3]; +var seekBraceLine = lines[4]; + +var word1 = { + start: { line: wordLine.line, ch: 1 }, + end: { line: wordLine.line, ch: 5 } +}; +var word2 = { + start: { line: wordLine.line, ch: word1.end.ch + 2 }, + end: { line: wordLine.line, ch: word1.end.ch + 4 } +}; +var word3 = { + start: { line: bigWordLine.line, ch: 1 }, + end: { line: bigWordLine.line, ch: 5 } +}; +var bigWord1 = word1; +var bigWord2 = word2; +var bigWord3 = { + start: { line: bigWordLine.line, ch: 1 }, + end: { line: bigWordLine.line, ch: 7 } +}; +var bigWord4 = { + start: { line: bigWordLine.line, ch: bigWord1.end.ch + 3 }, + end: { line: bigWordLine.line, ch: bigWord1.end.ch + 7 } +}; + +var oChars = [ { line: charLine.line, ch: 1 }, + { line: charLine.line, ch: 3 }, + { line: charLine.line, ch: 7 } ]; +var pChars = [ { line: charLine.line, ch: 2 }, + { line: charLine.line, ch: 4 }, + { line: charLine.line, ch: 6 }, + { line: charLine.line, ch: 8 } ]; +var numChars = [ { line: charLine.line, ch: 10 }, + { line: charLine.line, ch: 12 }, + { line: charLine.line, ch: 14 }, + { line: charLine.line, ch: 16 }, + { line: charLine.line, ch: 18 }]; +var parens1 = { + start: { line: bracesLine.line, ch: 1 }, + end: { line: bracesLine.line, ch: 3 } +}; +var squares1 = { + start: { line: bracesLine.line, ch: 5 }, + end: { line: bracesLine.line, ch: 7 } +}; +var curlys1 = { + start: { line: bracesLine.line, ch: 9 }, + end: { line: bracesLine.line, ch: 11 } +}; +var seekOutside = { + start: { line: seekBraceLine.line, ch: 1 }, + end: { line: seekBraceLine.line, ch: 16 } +}; +var seekInside = { + start: { line: seekBraceLine.line, ch: 14 }, + end: { line: seekBraceLine.line, ch: 11 } +}; + +function copyCursor(cur) { + return { ch: cur.ch, line: cur.line }; +} + +function testVim(name, run, opts, expectedFail) { + var vimOpts = { + lineNumbers: true, + keyMap: 'vim', + showCursorWhenSelecting: true, + value: code + }; + for (var prop in opts) { + if (opts.hasOwnProperty(prop)) { + vimOpts[prop] = opts[prop]; + } + } + return test('vim_' + name, function() { + var place = document.getElementById("testground"); + var cm = CodeMirror(place, vimOpts); + CodeMirror.Vim.maybeInitState(cm); + var vim = cm.vimState; + + function doKeysFn(cm) { + return function(args) { + if (args instanceof Array) { + arguments = args; + } + for (var i = 0; i < arguments.length; i++) { + CodeMirror.Vim.handleKey(cm, arguments[i]); + } + } + } + function doInsertModeKeysFn(cm) { + return function(args) { + if (args instanceof Array) { arguments = args; } + function executeHandler(handler) { + if (typeof handler == 'string') { + CodeMirror.commands[handler](cm); + } else { + handler(cm); + } + return true; + } + for (var i = 0; i < arguments.length; i++) { + var key = arguments[i]; + // Find key in keymap and handle. + var handled = CodeMirror.lookupKey(key, ['vim-insert'], executeHandler); + // Record for insert mode. + if (handled === true && cm.vimState.insertMode && arguments[i] != 'Esc') { + var lastChange = CodeMirror.Vim.getVimGlobalState_().macroModeState.lastInsertModeChanges; + if (lastChange) { + lastChange.changes.push(new CodeMirror.Vim.InsertModeKey(key)); + } + } + } + } + } + function doExFn(cm) { + return function(command) { + cm.openDialog = helpers.fakeOpenDialog(command); + helpers.doKeys(':'); + } + } + function assertCursorAtFn(cm) { + return function(line, ch) { + var pos; + if (ch == null && typeof line.line == 'number') { + pos = line; + } else { + pos = makeCursor(line, ch); + } + eqPos(pos, cm.getCursor()); + } + } + function fakeOpenDialog(result) { + return function(text, callback) { + return callback(result); + } + } + var helpers = { + doKeys: doKeysFn(cm), + // Warning: Only emulates keymap events, not character insertions. Use + // replaceRange to simulate character insertions. + // Keys are in CodeMirror format, NOT vim format. + doInsertModeKeys: doInsertModeKeysFn(cm), + doEx: doExFn(cm), + assertCursorAt: assertCursorAtFn(cm), + fakeOpenDialog: fakeOpenDialog, + getRegisterController: function() { + return CodeMirror.Vim.getRegisterController(); + } + } + CodeMirror.Vim.clearVimGlobalState_(); + var successful = false; + try { + run(cm, vim, helpers); + successful = true; + } finally { + if ((debug && !successful) || verbose) { + place.style.visibility = "visible"; + } else { + place.removeChild(cm.getWrapperElement()); + } + } + }, expectedFail); +}; +testVim('qq@q', function(cm, vim, helpers) { + cm.setCursor(0, 0); + helpers.doKeys('q', 'q', 'l', 'l', 'q'); + helpers.assertCursorAt(0,2); + helpers.doKeys('@', 'q'); + helpers.assertCursorAt(0,4); +}, { value: ' '}); +testVim('@@', function(cm, vim, helpers) { + cm.setCursor(0, 0); + helpers.doKeys('q', 'q', 'l', 'l', 'q'); + helpers.assertCursorAt(0,2); + helpers.doKeys('@', 'q'); + helpers.assertCursorAt(0,4); + helpers.doKeys('@', '@'); + helpers.assertCursorAt(0,6); +}, { value: ' '}); +var jumplistScene = ''+ + 'word\n'+ + '(word)\n'+ + '{word\n'+ + 'word.\n'+ + '\n'+ + 'word search\n'+ + '}word\n'+ + 'word\n'+ + 'word\n'; +function testJumplist(name, keys, endPos, startPos, dialog) { + endPos = makeCursor(endPos[0], endPos[1]); + startPos = makeCursor(startPos[0], startPos[1]); + testVim(name, function(cm, vim, helpers) { + CodeMirror.Vim.clearVimGlobalState_(); + if(dialog)cm.openDialog = helpers.fakeOpenDialog('word'); + cm.setCursor(startPos); + helpers.doKeys.apply(null, keys); + helpers.assertCursorAt(endPos); + }, {value: jumplistScene}); +}; +testJumplist('jumplist_H', ['H', ''], [5,2], [5,2]); +testJumplist('jumplist_M', ['M', ''], [2,2], [2,2]); +testJumplist('jumplist_L', ['L', ''], [2,2], [2,2]); +testJumplist('jumplist_[[', ['[', '[', ''], [5,2], [5,2]); +testJumplist('jumplist_]]', [']', ']', ''], [2,2], [2,2]); +testJumplist('jumplist_G', ['G', ''], [5,2], [5,2]); +testJumplist('jumplist_gg', ['g', 'g', ''], [5,2], [5,2]); +testJumplist('jumplist_%', ['%', ''], [1,5], [1,5]); +testJumplist('jumplist_{', ['{', ''], [1,5], [1,5]); +testJumplist('jumplist_}', ['}', ''], [1,5], [1,5]); +testJumplist('jumplist_\'', ['m', 'a', 'h', '\'', 'a', 'h', ''], [1,5], [1,5]); +testJumplist('jumplist_`', ['m', 'a', 'h', '`', 'a', 'h', ''], [1,5], [1,5]); +testJumplist('jumplist_*_cachedCursor', ['*', ''], [1,3], [1,3]); +testJumplist('jumplist_#_cachedCursor', ['#', ''], [1,3], [1,3]); +testJumplist('jumplist_n', ['#', 'n', ''], [1,1], [2,3]); +testJumplist('jumplist_N', ['#', 'N', ''], [1,1], [2,3]); +testJumplist('jumplist_repeat_', ['*', '*', '*', '3', ''], [2,3], [2,3]); +testJumplist('jumplist_repeat_', ['*', '*', '*', '3', '', '2', ''], [5,0], [2,3]); +testJumplist('jumplist_repeated_motion', ['3', '*', ''], [2,3], [2,3]); +testJumplist('jumplist_/', ['/', ''], [2,3], [2,3], 'dialog'); +testJumplist('jumplist_?', ['?', ''], [2,3], [2,3], 'dialog'); +testJumplist('jumplist_skip_delted_mark', + ['*', 'n', 'n', 'k', 'd', 'k', '', '', ''], + [0,2], [0,2]); +testJumplist('jumplist_skip_delted_mark', + ['*', 'n', 'n', 'k', 'd', 'k', '', '', ''], + [1,0], [0,2]); +/** + * @param name Name of the test + * @param keys An array of keys or a string with a single key to simulate. + * @param endPos The expected end position of the cursor. + * @param startPos The position the cursor should start at, defaults to 0, 0. + */ +function testMotion(name, keys, endPos, startPos) { + testVim(name, function(cm, vim, helpers) { + if (!startPos) { + startPos = { line: 0, ch: 0 }; + } + cm.setCursor(startPos); + helpers.doKeys(keys); + helpers.assertCursorAt(endPos); + }); +}; + +function makeCursor(line, ch) { + return { line: line, ch: ch }; +}; + +function offsetCursor(cur, offsetLine, offsetCh) { + return { line: cur.line + offsetLine, ch: cur.ch + offsetCh }; +}; + +// Motion tests +testMotion('|', '|', makeCursor(0, 0), makeCursor(0,4)); +testMotion('|_repeat', ['3', '|'], makeCursor(0, 2), makeCursor(0,4)); +testMotion('h', 'h', makeCursor(0, 0), word1.start); +testMotion('h_repeat', ['3', 'h'], offsetCursor(word1.end, 0, -3), word1.end); +testMotion('l', 'l', makeCursor(0, 1)); +testMotion('l_repeat', ['2', 'l'], makeCursor(0, 2)); +testMotion('j', 'j', offsetCursor(word1.end, 1, 0), word1.end); +testMotion('j_repeat', ['2', 'j'], offsetCursor(word1.end, 2, 0), word1.end); +testMotion('k', 'k', offsetCursor(word3.end, -1, 0), word3.end); +testMotion('k_repeat', ['2', 'k'], makeCursor(0, 4), makeCursor(2, 4)); +testMotion('w', 'w', word1.start); +testMotion('w_multiple_newlines_no_space', 'w', makeCursor(12, 2), makeCursor(11, 2)); +testMotion('w_multiple_newlines_with_space', 'w', makeCursor(14, 0), makeCursor(12, 51)); +testMotion('w_repeat', ['2', 'w'], word2.start); +testMotion('w_wrap', ['w'], word3.start, word2.start); +testMotion('w_endOfDocument', 'w', endOfDocument, endOfDocument); +testMotion('w_start_to_end', ['1000', 'w'], endOfDocument, makeCursor(0, 0)); +testMotion('W', 'W', bigWord1.start); +testMotion('W_repeat', ['2', 'W'], bigWord3.start, bigWord1.start); +testMotion('e', 'e', word1.end); +testMotion('e_repeat', ['2', 'e'], word2.end); +testMotion('e_wrap', 'e', word3.end, word2.end); +testMotion('e_endOfDocument', 'e', endOfDocument, endOfDocument); +testMotion('e_start_to_end', ['1000', 'e'], endOfDocument, makeCursor(0, 0)); +testMotion('b', 'b', word3.start, word3.end); +testMotion('b_repeat', ['2', 'b'], word2.start, word3.end); +testMotion('b_wrap', 'b', word2.start, word3.start); +testMotion('b_startOfDocument', 'b', makeCursor(0, 0), makeCursor(0, 0)); +testMotion('b_end_to_start', ['1000', 'b'], makeCursor(0, 0), endOfDocument); +testMotion('ge', ['g', 'e'], word2.end, word3.end); +testMotion('ge_repeat', ['2', 'g', 'e'], word1.end, word3.start); +testMotion('ge_wrap', ['g', 'e'], word2.end, word3.start); +testMotion('ge_startOfDocument', ['g', 'e'], makeCursor(0, 0), + makeCursor(0, 0)); +testMotion('ge_end_to_start', ['1000', 'g', 'e'], makeCursor(0, 0), endOfDocument); +testMotion('gg', ['g', 'g'], makeCursor(lines[0].line, lines[0].textStart), + makeCursor(3, 1)); +testMotion('gg_repeat', ['3', 'g', 'g'], + makeCursor(lines[2].line, lines[2].textStart)); +testMotion('G', 'G', + makeCursor(lines[lines.length - 1].line, lines[lines.length - 1].textStart), + makeCursor(3, 1)); +testMotion('G_repeat', ['3', 'G'], makeCursor(lines[2].line, + lines[2].textStart)); +// TODO: Make the test code long enough to test Ctrl-F and Ctrl-B. +testMotion('0', '0', makeCursor(0, 0), makeCursor(0, 8)); +testMotion('^', '^', makeCursor(0, lines[0].textStart), makeCursor(0, 8)); +testMotion('+', '+', makeCursor(1, lines[1].textStart), makeCursor(0, 8)); +testMotion('-', '-', makeCursor(0, lines[0].textStart), makeCursor(1, 4)); +testMotion('_', ['6','_'], makeCursor(5, lines[5].textStart), makeCursor(0, 8)); +testMotion('$', '$', makeCursor(0, lines[0].length - 1), makeCursor(0, 1)); +testMotion('$_repeat', ['2', '$'], makeCursor(1, lines[1].length - 1), + makeCursor(0, 3)); +testMotion('f', ['f', 'p'], pChars[0], makeCursor(charLine.line, 0)); +testMotion('f_repeat', ['2', 'f', 'p'], pChars[2], pChars[0]); +testMotion('f_num', ['f', '2'], numChars[2], makeCursor(charLine.line, 0)); +testMotion('t', ['t','p'], offsetCursor(pChars[0], 0, -1), + makeCursor(charLine.line, 0)); +testMotion('t_repeat', ['2', 't', 'p'], offsetCursor(pChars[2], 0, -1), + pChars[0]); +testMotion('F', ['F', 'p'], pChars[0], pChars[1]); +testMotion('F_repeat', ['2', 'F', 'p'], pChars[0], pChars[2]); +testMotion('T', ['T', 'p'], offsetCursor(pChars[0], 0, 1), pChars[1]); +testMotion('T_repeat', ['2', 'T', 'p'], offsetCursor(pChars[0], 0, 1), pChars[2]); +testMotion('%_parens', ['%'], parens1.end, parens1.start); +testMotion('%_squares', ['%'], squares1.end, squares1.start); +testMotion('%_braces', ['%'], curlys1.end, curlys1.start); +testMotion('%_seek_outside', ['%'], seekOutside.end, seekOutside.start); +testMotion('%_seek_inside', ['%'], seekInside.end, seekInside.start); +testVim('%_seek_skip', function(cm, vim, helpers) { + cm.setCursor(0,0); + helpers.doKeys(['%']); + helpers.assertCursorAt(0,9); +}, {value:'01234"("()'}); +testVim('%_skip_string', function(cm, vim, helpers) { + cm.setCursor(0,0); + helpers.doKeys(['%']); + helpers.assertCursorAt(0,4); + cm.setCursor(0,2); + helpers.doKeys(['%']); + helpers.assertCursorAt(0,0); +}, {value:'(")")'}); +(')') +testVim('%_skip_comment', function(cm, vim, helpers) { + cm.setCursor(0,0); + helpers.doKeys(['%']); + helpers.assertCursorAt(0,6); + cm.setCursor(0,3); + helpers.doKeys(['%']); + helpers.assertCursorAt(0,0); +}, {value:'(/*)*/)'}); +// Make sure that moving down after going to the end of a line always leaves you +// at the end of a line, but preserves the offset in other cases +testVim('Changing lines after Eol operation', function(cm, vim, helpers) { + cm.setCursor(0,0); + helpers.doKeys(['$']); + helpers.doKeys(['j']); + // After moving to Eol and then down, we should be at Eol of line 2 + helpers.assertCursorAt({ line: 1, ch: lines[1].length - 1 }); + helpers.doKeys(['j']); + // After moving down, we should be at Eol of line 3 + helpers.assertCursorAt({ line: 2, ch: lines[2].length - 1 }); + helpers.doKeys(['h']); + helpers.doKeys(['j']); + // After moving back one space and then down, since line 4 is shorter than line 2, we should + // be at Eol of line 2 - 1 + helpers.assertCursorAt({ line: 3, ch: lines[3].length - 1 }); + helpers.doKeys(['j']); + helpers.doKeys(['j']); + // After moving down again, since line 3 has enough characters, we should be back to the + // same place we were at on line 1 + helpers.assertCursorAt({ line: 5, ch: lines[2].length - 2 }); +}); +//making sure gj and gk recover from clipping +testVim('gj_gk_clipping', function(cm,vim,helpers){ + cm.setCursor(0, 1); + helpers.doKeys('g','j','g','j'); + helpers.assertCursorAt(2, 1); + helpers.doKeys('g','k','g','k'); + helpers.assertCursorAt(0, 1); +},{value: 'line 1\n\nline 2'}); +//testing a mix of j/k and gj/gk +testVim('j_k_and_gj_gk', function(cm,vim,helpers){ + cm.setSize(120); + cm.setCursor(0, 0); + //go to the last character on the first line + helpers.doKeys('$'); + //move up/down on the column within the wrapped line + //side-effect: cursor is not locked to eol anymore + helpers.doKeys('g','k'); + var cur=cm.getCursor(); + eq(cur.line,0); + is((cur.ch<176),'gk didn\'t move cursor back (1)'); + helpers.doKeys('g','j'); + helpers.assertCursorAt(0, 176); + //should move to character 177 on line 2 (j/k preserve character index within line) + helpers.doKeys('j'); + //due to different line wrapping, the cursor can be on a different screen-x now + //gj and gk preserve screen-x on movement, much like moveV + helpers.doKeys('3','g','k'); + cur=cm.getCursor(); + eq(cur.line,1); + is((cur.ch<176),'gk didn\'t move cursor back (2)'); + helpers.doKeys('g','j','2','g','j'); + //should return to the same character-index + helpers.doKeys('k'); + helpers.assertCursorAt(0, 176); +},{ lineWrapping:true, value: 'This line is intentially long to test movement of gj and gk over wrapped lines. I will start on the end of this line, then make a step up and back to set the origin for j and k.\nThis line is supposed to be even longer than the previous. I will jump here and make another wiggle with gj and gk, before I jump back to the line above. Both wiggles should not change my cursor\'s target character but both j/k and gj/gk change each other\'s reference position.'}); +testVim('gj_gk', function(cm, vim, helpers) { + if (phantom) return; + cm.setSize(120); + // Test top of document edge case. + cm.setCursor(0, 4); + helpers.doKeys('g', 'j'); + helpers.doKeys('10', 'g', 'k'); + helpers.assertCursorAt(0, 4); + + // Test moving down preserves column position. + helpers.doKeys('g', 'j'); + var pos1 = cm.getCursor(); + var expectedPos2 = { line: 0, ch: (pos1.ch - 4) * 2 + 4}; + helpers.doKeys('g', 'j'); + helpers.assertCursorAt(expectedPos2); + + // Move to the last character + cm.setCursor(0, 0); + // Move left to reset HSPos + helpers.doKeys('h'); + // Test bottom of document edge case. + helpers.doKeys('100', 'g', 'j'); + var endingPos = cm.getCursor(); + is(endingPos != 0, 'gj should not be on wrapped line 0'); + var topLeftCharCoords = cm.charCoords(makeCursor(0, 0)); + var endingCharCoords = cm.charCoords(endingPos); + is(topLeftCharCoords.left == endingCharCoords.left, 'gj should end up on column 0'); +},{ lineNumbers: false, lineWrapping:true, value: 'Thislineisintentiallylongtotestmovementofgjandgkoverwrappedlines.' }); +testVim('}', function(cm, vim, helpers) { + cm.setCursor(0, 0); + helpers.doKeys('}'); + helpers.assertCursorAt(1, 0); + cm.setCursor(0, 0); + helpers.doKeys('2', '}'); + helpers.assertCursorAt(4, 0); + cm.setCursor(0, 0); + helpers.doKeys('6', '}'); + helpers.assertCursorAt(5, 0); +}, { value: 'a\n\nb\nc\n\nd' }); +testVim('{', function(cm, vim, helpers) { + cm.setCursor(5, 0); + helpers.doKeys('{'); + helpers.assertCursorAt(4, 0); + cm.setCursor(5, 0); + helpers.doKeys('2', '{'); + helpers.assertCursorAt(1, 0); + cm.setCursor(5, 0); + helpers.doKeys('6', '{'); + helpers.assertCursorAt(0, 0); +}, { value: 'a\n\nb\nc\n\nd' }); + +// Operator tests +testVim('dl', function(cm, vim, helpers) { + var curStart = makeCursor(0, 0); + cm.setCursor(curStart); + helpers.doKeys('d', 'l'); + eq('word1 ', cm.getValue()); + var register = helpers.getRegisterController().getRegister(); + eq(' ', register.text); + is(!register.linewise); + eqPos(curStart, cm.getCursor()); +}, { value: ' word1 ' }); +testVim('dl_eol', function(cm, vim, helpers) { + // TODO: This test is incorrect. The cursor should end up at (0, 5). + var curStart = makeCursor(0, 6); + cm.setCursor(curStart); + helpers.doKeys('d', 'l'); + eq(' word1', cm.getValue()); + var register = helpers.getRegisterController().getRegister(); + eq(' ', register.text); + is(!register.linewise); + helpers.assertCursorAt(0, 6); +}, { value: ' word1 ' }); +testVim('dl_repeat', function(cm, vim, helpers) { + var curStart = makeCursor(0, 0); + cm.setCursor(curStart); + helpers.doKeys('2', 'd', 'l'); + eq('ord1 ', cm.getValue()); + var register = helpers.getRegisterController().getRegister(); + eq(' w', register.text); + is(!register.linewise); + eqPos(curStart, cm.getCursor()); +}, { value: ' word1 ' }); +testVim('dh', function(cm, vim, helpers) { + var curStart = makeCursor(0, 3); + cm.setCursor(curStart); + helpers.doKeys('d', 'h'); + eq(' wrd1 ', cm.getValue()); + var register = helpers.getRegisterController().getRegister(); + eq('o', register.text); + is(!register.linewise); + eqPos(offsetCursor(curStart, 0 , -1), cm.getCursor()); +}, { value: ' word1 ' }); +testVim('dj', function(cm, vim, helpers) { + var curStart = makeCursor(0, 3); + cm.setCursor(curStart); + helpers.doKeys('d', 'j'); + eq(' word3', cm.getValue()); + var register = helpers.getRegisterController().getRegister(); + eq(' word1\nword2\n', register.text); + is(register.linewise); + helpers.assertCursorAt(0, 1); +}, { value: ' word1\nword2\n word3' }); +testVim('dj_end_of_document', function(cm, vim, helpers) { + var curStart = makeCursor(0, 3); + cm.setCursor(curStart); + helpers.doKeys('d', 'j'); + eq(' word1 ', cm.getValue()); + var register = helpers.getRegisterController().getRegister(); + eq('', register.text); + is(!register.linewise); + helpers.assertCursorAt(0, 3); +}, { value: ' word1 ' }); +testVim('dk', function(cm, vim, helpers) { + var curStart = makeCursor(1, 3); + cm.setCursor(curStart); + helpers.doKeys('d', 'k'); + eq(' word3', cm.getValue()); + var register = helpers.getRegisterController().getRegister(); + eq(' word1\nword2\n', register.text); + is(register.linewise); + helpers.assertCursorAt(0, 1); +}, { value: ' word1\nword2\n word3' }); +testVim('dk_start_of_document', function(cm, vim, helpers) { + var curStart = makeCursor(0, 3); + cm.setCursor(curStart); + helpers.doKeys('d', 'k'); + eq(' word1 ', cm.getValue()); + var register = helpers.getRegisterController().getRegister(); + eq('', register.text); + is(!register.linewise); + helpers.assertCursorAt(0, 3); +}, { value: ' word1 ' }); +testVim('dw_space', function(cm, vim, helpers) { + var curStart = makeCursor(0, 0); + cm.setCursor(curStart); + helpers.doKeys('d', 'w'); + eq('word1 ', cm.getValue()); + var register = helpers.getRegisterController().getRegister(); + eq(' ', register.text); + is(!register.linewise); + eqPos(curStart, cm.getCursor()); +}, { value: ' word1 ' }); +testVim('dw_word', function(cm, vim, helpers) { + var curStart = makeCursor(0, 1); + cm.setCursor(curStart); + helpers.doKeys('d', 'w'); + eq(' word2', cm.getValue()); + var register = helpers.getRegisterController().getRegister(); + eq('word1 ', register.text); + is(!register.linewise); + eqPos(curStart, cm.getCursor()); +}, { value: ' word1 word2' }); +testVim('dw_only_word', function(cm, vim, helpers) { + // Test that if there is only 1 word left, dw deletes till the end of the + // line. + var curStart = makeCursor(0, 1); + cm.setCursor(curStart); + helpers.doKeys('d', 'w'); + eq(' ', cm.getValue()); + var register = helpers.getRegisterController().getRegister(); + eq('word1 ', register.text); + is(!register.linewise); + eqPos(curStart, cm.getCursor()); +}, { value: ' word1 ' }); +testVim('dw_eol', function(cm, vim, helpers) { + // Assert that dw does not delete the newline if last word to delete is at end + // of line. + var curStart = makeCursor(0, 1); + cm.setCursor(curStart); + helpers.doKeys('d', 'w'); + eq(' \nword2', cm.getValue()); + var register = helpers.getRegisterController().getRegister(); + eq('word1', register.text); + is(!register.linewise); + eqPos(curStart, cm.getCursor()); +}, { value: ' word1\nword2' }); +testVim('dw_eol_with_multiple_newlines', function(cm, vim, helpers) { + // Assert that dw does not delete the newline if last word to delete is at end + // of line and it is followed by multiple newlines. + var curStart = makeCursor(0, 1); + cm.setCursor(curStart); + helpers.doKeys('d', 'w'); + eq(' \n\nword2', cm.getValue()); + var register = helpers.getRegisterController().getRegister(); + eq('word1', register.text); + is(!register.linewise); + eqPos(curStart, cm.getCursor()); +}, { value: ' word1\n\nword2' }); +testVim('dw_empty_line_followed_by_whitespace', function(cm, vim, helpers) { + cm.setCursor(0, 0); + helpers.doKeys('d', 'w'); + eq(' \nword', cm.getValue()); +}, { value: '\n \nword' }); +testVim('dw_empty_line_followed_by_word', function(cm, vim, helpers) { + cm.setCursor(0, 0); + helpers.doKeys('d', 'w'); + eq('word', cm.getValue()); +}, { value: '\nword' }); +testVim('dw_empty_line_followed_by_empty_line', function(cm, vim, helpers) { + cm.setCursor(0, 0); + helpers.doKeys('d', 'w'); + eq('\n', cm.getValue()); +}, { value: '\n\n' }); +testVim('dw_whitespace_followed_by_whitespace', function(cm, vim, helpers) { + cm.setCursor(0, 0); + helpers.doKeys('d', 'w'); + eq('\n \n', cm.getValue()); +}, { value: ' \n \n' }); +testVim('dw_whitespace_followed_by_empty_line', function(cm, vim, helpers) { + cm.setCursor(0, 0); + helpers.doKeys('d', 'w'); + eq('\n\n', cm.getValue()); +}, { value: ' \n\n' }); +testVim('dw_word_whitespace_word', function(cm, vim, helpers) { + cm.setCursor(0, 0); + helpers.doKeys('d', 'w'); + eq('\n \nword2', cm.getValue()); +}, { value: 'word1\n \nword2'}) +testVim('dw_end_of_document', function(cm, vim, helpers) { + cm.setCursor(1, 2); + helpers.doKeys('d', 'w'); + eq('\nab', cm.getValue()); +}, { value: '\nabc' }); +testVim('dw_repeat', function(cm, vim, helpers) { + // Assert that dw does delete newline if it should go to the next line, and + // that repeat works properly. + var curStart = makeCursor(0, 1); + cm.setCursor(curStart); + helpers.doKeys('d', '2', 'w'); + eq(' ', cm.getValue()); + var register = helpers.getRegisterController().getRegister(); + eq('word1\nword2', register.text); + is(!register.linewise); + eqPos(curStart, cm.getCursor()); +}, { value: ' word1\nword2' }); +testVim('de_word_start_and_empty_lines', function(cm, vim, helpers) { + cm.setCursor(0, 0); + helpers.doKeys('d', 'e'); + eq('\n\n', cm.getValue()); +}, { value: 'word\n\n' }); +testVim('de_word_end_and_empty_lines', function(cm, vim, helpers) { + cm.setCursor(0, 3); + helpers.doKeys('d', 'e'); + eq('wor', cm.getValue()); +}, { value: 'word\n\n\n' }); +testVim('de_whitespace_and_empty_lines', function(cm, vim, helpers) { + cm.setCursor(0, 0); + helpers.doKeys('d', 'e'); + eq('', cm.getValue()); +}, { value: ' \n\n\n' }); +testVim('de_end_of_document', function(cm, vim, helpers) { + cm.setCursor(1, 2); + helpers.doKeys('d', 'e'); + eq('\nab', cm.getValue()); +}, { value: '\nabc' }); +testVim('db_empty_lines', function(cm, vim, helpers) { + cm.setCursor(2, 0); + helpers.doKeys('d', 'b'); + eq('\n\n', cm.getValue()); +}, { value: '\n\n\n' }); +testVim('db_word_start_and_empty_lines', function(cm, vim, helpers) { + cm.setCursor(2, 0); + helpers.doKeys('d', 'b'); + eq('\nword', cm.getValue()); +}, { value: '\n\nword' }); +testVim('db_word_end_and_empty_lines', function(cm, vim, helpers) { + cm.setCursor(2, 3); + helpers.doKeys('d', 'b'); + eq('\n\nd', cm.getValue()); +}, { value: '\n\nword' }); +testVim('db_whitespace_and_empty_lines', function(cm, vim, helpers) { + cm.setCursor(2, 0); + helpers.doKeys('d', 'b'); + eq('', cm.getValue()); +}, { value: '\n \n' }); +testVim('db_start_of_document', function(cm, vim, helpers) { + cm.setCursor(0, 0); + helpers.doKeys('d', 'b'); + eq('abc\n', cm.getValue()); +}, { value: 'abc\n' }); +testVim('dge_empty_lines', function(cm, vim, helpers) { + cm.setCursor(1, 0); + helpers.doKeys('d', 'g', 'e'); + // Note: In real VIM the result should be '', but it's not quite consistent, + // since 2 newlines are deleted. But in the similar case of word\n\n, only + // 1 newline is deleted. We'll diverge from VIM's behavior since it's much + // easier this way. + eq('\n', cm.getValue()); +}, { value: '\n\n' }); +testVim('dge_word_and_empty_lines', function(cm, vim, helpers) { + cm.setCursor(1, 0); + helpers.doKeys('d', 'g', 'e'); + eq('wor\n', cm.getValue()); +}, { value: 'word\n\n'}); +testVim('dge_whitespace_and_empty_lines', function(cm, vim, helpers) { + cm.setCursor(2, 0); + helpers.doKeys('d', 'g', 'e'); + eq('', cm.getValue()); +}, { value: '\n \n' }); +testVim('dge_start_of_document', function(cm, vim, helpers) { + cm.setCursor(0, 0); + helpers.doKeys('d', 'g', 'e'); + eq('bc\n', cm.getValue()); +}, { value: 'abc\n' }); +testVim('d_inclusive', function(cm, vim, helpers) { + // Assert that when inclusive is set, the character the cursor is on gets + // deleted too. + var curStart = makeCursor(0, 1); + cm.setCursor(curStart); + helpers.doKeys('d', 'e'); + eq(' ', cm.getValue()); + var register = helpers.getRegisterController().getRegister(); + eq('word1', register.text); + is(!register.linewise); + eqPos(curStart, cm.getCursor()); +}, { value: ' word1 ' }); +testVim('d_reverse', function(cm, vim, helpers) { + // Test that deleting in reverse works. + cm.setCursor(1, 0); + helpers.doKeys('d', 'b'); + eq(' word2 ', cm.getValue()); + var register = helpers.getRegisterController().getRegister(); + eq('word1\n', register.text); + is(!register.linewise); + helpers.assertCursorAt(0, 1); +}, { value: ' word1\nword2 ' }); +testVim('dd', function(cm, vim, helpers) { + cm.setCursor(0, 3); + var expectedBuffer = cm.getRange({ line: 0, ch: 0 }, + { line: 1, ch: 0 }); + var expectedLineCount = cm.lineCount() - 1; + helpers.doKeys('d', 'd'); + eq(expectedLineCount, cm.lineCount()); + var register = helpers.getRegisterController().getRegister(); + eq(expectedBuffer, register.text); + is(register.linewise); + helpers.assertCursorAt(0, lines[1].textStart); +}); +testVim('dd_prefix_repeat', function(cm, vim, helpers) { + cm.setCursor(0, 3); + var expectedBuffer = cm.getRange({ line: 0, ch: 0 }, + { line: 2, ch: 0 }); + var expectedLineCount = cm.lineCount() - 2; + helpers.doKeys('2', 'd', 'd'); + eq(expectedLineCount, cm.lineCount()); + var register = helpers.getRegisterController().getRegister(); + eq(expectedBuffer, register.text); + is(register.linewise); + helpers.assertCursorAt(0, lines[2].textStart); +}); +testVim('dd_motion_repeat', function(cm, vim, helpers) { + cm.setCursor(0, 3); + var expectedBuffer = cm.getRange({ line: 0, ch: 0 }, + { line: 2, ch: 0 }); + var expectedLineCount = cm.lineCount() - 2; + helpers.doKeys('d', '2', 'd'); + eq(expectedLineCount, cm.lineCount()); + var register = helpers.getRegisterController().getRegister(); + eq(expectedBuffer, register.text); + is(register.linewise); + helpers.assertCursorAt(0, lines[2].textStart); +}); +testVim('dd_multiply_repeat', function(cm, vim, helpers) { + cm.setCursor(0, 3); + var expectedBuffer = cm.getRange({ line: 0, ch: 0 }, + { line: 6, ch: 0 }); + var expectedLineCount = cm.lineCount() - 6; + helpers.doKeys('2', 'd', '3', 'd'); + eq(expectedLineCount, cm.lineCount()); + var register = helpers.getRegisterController().getRegister(); + eq(expectedBuffer, register.text); + is(register.linewise); + helpers.assertCursorAt(0, lines[6].textStart); +}); +testVim('dd_lastline', function(cm, vim, helpers) { + cm.setCursor(cm.lineCount(), 0); + var expectedLineCount = cm.lineCount() - 1; + helpers.doKeys('d', 'd'); + eq(expectedLineCount, cm.lineCount()); + helpers.assertCursorAt(cm.lineCount() - 1, 0); +}); +testVim('cw', function(cm, vim, helpers) { + cm.setCursor(0, 0); + helpers.doKeys('c', '2', 'w'); + eq(' word3', cm.getValue()); + helpers.assertCursorAt(0, 0); +}, { value: 'word1 word2 word3'}); +// Yank commands should behave the exact same as d commands, expect that nothing +// gets deleted. +testVim('yw_repeat', function(cm, vim, helpers) { + // Assert that yw does yank newline if it should go to the next line, and + // that repeat works properly. + var curStart = makeCursor(0, 1); + cm.setCursor(curStart); + helpers.doKeys('y', '2', 'w'); + eq(' word1\nword2', cm.getValue()); + var register = helpers.getRegisterController().getRegister(); + eq('word1\nword2', register.text); + is(!register.linewise); + eqPos(curStart, cm.getCursor()); +}, { value: ' word1\nword2' }); +testVim('yy_multiply_repeat', function(cm, vim, helpers) { + var curStart = makeCursor(0, 3); + cm.setCursor(curStart); + var expectedBuffer = cm.getRange({ line: 0, ch: 0 }, + { line: 6, ch: 0 }); + var expectedLineCount = cm.lineCount(); + helpers.doKeys('2', 'y', '3', 'y'); + eq(expectedLineCount, cm.lineCount()); + var register = helpers.getRegisterController().getRegister(); + eq(expectedBuffer, register.text); + is(register.linewise); + eqPos(curStart, cm.getCursor()); +}); +// Change commands behave like d commands except that it also enters insert +// mode. In addition, when the change is linewise, an additional newline is +// inserted so that insert mode starts on that line. +testVim('cw_repeat', function(cm, vim, helpers) { + // Assert that cw does delete newline if it should go to the next line, and + // that repeat works properly. + var curStart = makeCursor(0, 1); + cm.setCursor(curStart); + helpers.doKeys('c', '2', 'w'); + eq(' ', cm.getValue()); + var register = helpers.getRegisterController().getRegister(); + eq('word1\nword2', register.text); + is(!register.linewise); + eqPos(curStart, cm.getCursor()); + eq('vim-insert', cm.getOption('keyMap')); +}, { value: ' word1\nword2' }); +testVim('cc_multiply_repeat', function(cm, vim, helpers) { + cm.setCursor(0, 3); + var expectedBuffer = cm.getRange({ line: 0, ch: 0 }, + { line: 6, ch: 0 }); + var expectedLineCount = cm.lineCount() - 5; + helpers.doKeys('2', 'c', '3', 'c'); + eq(expectedLineCount, cm.lineCount()); + var register = helpers.getRegisterController().getRegister(); + eq(expectedBuffer, register.text); + is(register.linewise); + helpers.assertCursorAt(0, lines[0].textStart); + eq('vim-insert', cm.getOption('keyMap')); +}); +// Swapcase commands edit in place and do not modify registers. +testVim('g~w_repeat', function(cm, vim, helpers) { + // Assert that dw does delete newline if it should go to the next line, and + // that repeat works properly. + var curStart = makeCursor(0, 1); + cm.setCursor(curStart); + helpers.doKeys('g', '~', '2', 'w'); + eq(' WORD1\nWORD2', cm.getValue()); + var register = helpers.getRegisterController().getRegister(); + eq('', register.text); + is(!register.linewise); + eqPos(curStart, cm.getCursor()); +}, { value: ' word1\nword2' }); +testVim('g~g~', function(cm, vim, helpers) { + var curStart = makeCursor(0, 3); + cm.setCursor(curStart); + var expectedLineCount = cm.lineCount(); + var expectedValue = cm.getValue().toUpperCase(); + helpers.doKeys('2', 'g', '~', '3', 'g', '~'); + eq(expectedValue, cm.getValue()); + var register = helpers.getRegisterController().getRegister(); + eq('', register.text); + is(!register.linewise); + eqPos(curStart, cm.getCursor()); +}, { value: ' word1\nword2\nword3\nword4\nword5\nword6' }); +testVim('>{motion}', function(cm, vim, helpers) { + cm.setCursor(1, 3); + var expectedLineCount = cm.lineCount(); + var expectedValue = ' word1\n word2\nword3 '; + helpers.doKeys('>', 'k'); + eq(expectedValue, cm.getValue()); + var register = helpers.getRegisterController().getRegister(); + eq('', register.text); + is(!register.linewise); + helpers.assertCursorAt(0, 3); +}, { value: ' word1\nword2\nword3 ', indentUnit: 2 }); +testVim('>>', function(cm, vim, helpers) { + cm.setCursor(0, 3); + var expectedLineCount = cm.lineCount(); + var expectedValue = ' word1\n word2\nword3 '; + helpers.doKeys('2', '>', '>'); + eq(expectedValue, cm.getValue()); + var register = helpers.getRegisterController().getRegister(); + eq('', register.text); + is(!register.linewise); + helpers.assertCursorAt(0, 3); +}, { value: ' word1\nword2\nword3 ', indentUnit: 2 }); +testVim('<{motion}', function(cm, vim, helpers) { + cm.setCursor(1, 3); + var expectedLineCount = cm.lineCount(); + var expectedValue = ' word1\nword2\nword3 '; + helpers.doKeys('<', 'k'); + eq(expectedValue, cm.getValue()); + var register = helpers.getRegisterController().getRegister(); + eq('', register.text); + is(!register.linewise); + helpers.assertCursorAt(0, 1); +}, { value: ' word1\n word2\nword3 ', indentUnit: 2 }); +testVim('<<', function(cm, vim, helpers) { + cm.setCursor(0, 3); + var expectedLineCount = cm.lineCount(); + var expectedValue = ' word1\nword2\nword3 '; + helpers.doKeys('2', '<', '<'); + eq(expectedValue, cm.getValue()); + var register = helpers.getRegisterController().getRegister(); + eq('', register.text); + is(!register.linewise); + helpers.assertCursorAt(0, 1); +}, { value: ' word1\n word2\nword3 ', indentUnit: 2 }); + +// Edit tests +function testEdit(name, before, pos, edit, after) { + return testVim(name, function(cm, vim, helpers) { + cm.setCursor(0, before.search(pos)); + helpers.doKeys.apply(this, edit.split('')); + eq(after, cm.getValue()); + }, {value: before}); +} + +// These Delete tests effectively cover word-wise Change, Visual & Yank. +// Tabs are used as differentiated whitespace to catch edge cases. +// Normal word: +testEdit('diw_mid_spc', 'foo \tbAr\t baz', /A/, 'diw', 'foo \t\t baz'); +testEdit('daw_mid_spc', 'foo \tbAr\t baz', /A/, 'daw', 'foo \tbaz'); +testEdit('diw_mid_punct', 'foo \tbAr.\t baz', /A/, 'diw', 'foo \t.\t baz'); +testEdit('daw_mid_punct', 'foo \tbAr.\t baz', /A/, 'daw', 'foo.\t baz'); +testEdit('diw_mid_punct2', 'foo \t,bAr.\t baz', /A/, 'diw', 'foo \t,.\t baz'); +testEdit('daw_mid_punct2', 'foo \t,bAr.\t baz', /A/, 'daw', 'foo \t,.\t baz'); +testEdit('diw_start_spc', 'bAr \tbaz', /A/, 'diw', ' \tbaz'); +testEdit('daw_start_spc', 'bAr \tbaz', /A/, 'daw', 'baz'); +testEdit('diw_start_punct', 'bAr. \tbaz', /A/, 'diw', '. \tbaz'); +testEdit('daw_start_punct', 'bAr. \tbaz', /A/, 'daw', '. \tbaz'); +testEdit('diw_end_spc', 'foo \tbAr', /A/, 'diw', 'foo \t'); +testEdit('daw_end_spc', 'foo \tbAr', /A/, 'daw', 'foo'); +testEdit('diw_end_punct', 'foo \tbAr.', /A/, 'diw', 'foo \t.'); +testEdit('daw_end_punct', 'foo \tbAr.', /A/, 'daw', 'foo.'); +// Big word: +testEdit('diW_mid_spc', 'foo \tbAr\t baz', /A/, 'diW', 'foo \t\t baz'); +testEdit('daW_mid_spc', 'foo \tbAr\t baz', /A/, 'daW', 'foo \tbaz'); +testEdit('diW_mid_punct', 'foo \tbAr.\t baz', /A/, 'diW', 'foo \t\t baz'); +testEdit('daW_mid_punct', 'foo \tbAr.\t baz', /A/, 'daW', 'foo \tbaz'); +testEdit('diW_mid_punct2', 'foo \t,bAr.\t baz', /A/, 'diW', 'foo \t\t baz'); +testEdit('daW_mid_punct2', 'foo \t,bAr.\t baz', /A/, 'daW', 'foo \tbaz'); +testEdit('diW_start_spc', 'bAr\t baz', /A/, 'diW', '\t baz'); +testEdit('daW_start_spc', 'bAr\t baz', /A/, 'daW', 'baz'); +testEdit('diW_start_punct', 'bAr.\t baz', /A/, 'diW', '\t baz'); +testEdit('daW_start_punct', 'bAr.\t baz', /A/, 'daW', 'baz'); +testEdit('diW_end_spc', 'foo \tbAr', /A/, 'diW', 'foo \t'); +testEdit('daW_end_spc', 'foo \tbAr', /A/, 'daW', 'foo'); +testEdit('diW_end_punct', 'foo \tbAr.', /A/, 'diW', 'foo \t'); +testEdit('daW_end_punct', 'foo \tbAr.', /A/, 'daW', 'foo'); + +// Operator-motion tests +testVim('D', function(cm, vim, helpers) { + var curStart = makeCursor(0, 3); + cm.setCursor(curStart); + helpers.doKeys('D'); + eq(' wo\nword2\n word3', cm.getValue()); + var register = helpers.getRegisterController().getRegister(); + eq('rd1', register.text); + is(!register.linewise); + helpers.assertCursorAt(0, 3); +}, { value: ' word1\nword2\n word3' }); +testVim('C', function(cm, vim, helpers) { + var curStart = makeCursor(0, 3); + cm.setCursor(curStart); + helpers.doKeys('C'); + eq(' wo\nword2\n word3', cm.getValue()); + var register = helpers.getRegisterController().getRegister(); + eq('rd1', register.text); + is(!register.linewise); + helpers.assertCursorAt(0, 3); + eq('vim-insert', cm.getOption('keyMap')); +}, { value: ' word1\nword2\n word3' }); +testVim('Y', function(cm, vim, helpers) { + var curStart = makeCursor(0, 3); + cm.setCursor(curStart); + helpers.doKeys('Y'); + eq(' word1\nword2\n word3', cm.getValue()); + var register = helpers.getRegisterController().getRegister(); + eq('rd1', register.text); + is(!register.linewise); + helpers.assertCursorAt(0, 3); +}, { value: ' word1\nword2\n word3' }); + +// Action tests +testVim('ctrl-a', function(cm, vim, helpers) { + cm.setCursor(0, 0); + helpers.doKeys(''); + eq('-9', cm.getValue()); + helpers.assertCursorAt(0, 1); + helpers.doKeys('2',''); + eq('-7', cm.getValue()); +}, {value: '-10'}); +testVim('ctrl-x', function(cm, vim, helpers) { + cm.setCursor(0, 0); + helpers.doKeys(''); + eq('-1', cm.getValue()); + helpers.assertCursorAt(0, 1); + helpers.doKeys('2',''); + eq('-3', cm.getValue()); +}, {value: '0'}); +testVim('/ search forward', function(cm, vim, helpers) { + ['', ''].forEach(function(key) { + cm.setCursor(0, 0); + helpers.doKeys(key); + helpers.assertCursorAt(0, 5); + helpers.doKeys('l'); + helpers.doKeys(key); + helpers.assertCursorAt(0, 10); + cm.setCursor(0, 11); + helpers.doKeys(key); + helpers.assertCursorAt(0, 11); + }); +}, {value: '__jmp1 jmp2 jmp'}); +testVim('a', function(cm, vim, helpers) { + cm.setCursor(0, 1); + helpers.doKeys('a'); + helpers.assertCursorAt(0, 2); + eq('vim-insert', cm.getOption('keyMap')); +}); +testVim('a_eol', function(cm, vim, helpers) { + cm.setCursor(0, lines[0].length - 1); + helpers.doKeys('a'); + helpers.assertCursorAt(0, lines[0].length); + eq('vim-insert', cm.getOption('keyMap')); +}); +testVim('i', function(cm, vim, helpers) { + cm.setCursor(0, 1); + helpers.doKeys('i'); + helpers.assertCursorAt(0, 1); + eq('vim-insert', cm.getOption('keyMap')); +}); +testVim('i_repeat', function(cm, vim, helpers) { + helpers.doKeys('3', 'i'); + cm.replaceRange('test', cm.getCursor()); + helpers.doInsertModeKeys('Esc'); + eq('testtesttest', cm.getValue()); + helpers.assertCursorAt(0, 11); +}, { value: '' }); +testVim('i_repeat_delete', function(cm, vim, helpers) { + cm.setCursor(0, 4); + helpers.doKeys('2', 'i'); + cm.replaceRange('z', cm.getCursor()); + helpers.doInsertModeKeys('Backspace', 'Backspace', 'Esc'); + eq('abe', cm.getValue()); + helpers.assertCursorAt(0, 1); +}, { value: 'abcde' }); +testVim('A', function(cm, vim, helpers) { + helpers.doKeys('A'); + helpers.assertCursorAt(0, lines[0].length); + eq('vim-insert', cm.getOption('keyMap')); +}); +testVim('I', function(cm, vim, helpers) { + cm.setCursor(0, 4); + helpers.doKeys('I'); + helpers.assertCursorAt(0, lines[0].textStart); + eq('vim-insert', cm.getOption('keyMap')); +}); +testVim('I_repeat', function(cm, vim, helpers) { + cm.setCursor(0, 1); + helpers.doKeys('3', 'I'); + cm.replaceRange('test', cm.getCursor()); + helpers.doInsertModeKeys('Esc'); + eq('testtesttestblah', cm.getValue()); + helpers.assertCursorAt(0, 11); +}, { value: 'blah' }); +testVim('o', function(cm, vim, helpers) { + cm.setCursor(0, 4); + helpers.doKeys('o'); + eq('word1\n\nword2', cm.getValue()); + helpers.assertCursorAt(1, 0); + eq('vim-insert', cm.getOption('keyMap')); +}, { value: 'word1\nword2' }); +testVim('o_repeat', function(cm, vim, helpers) { + cm.setCursor(0, 0); + helpers.doKeys('3', 'o'); + cm.replaceRange('test', cm.getCursor()); + helpers.doInsertModeKeys('Esc'); + eq('\ntest\ntest\ntest', cm.getValue()); + helpers.assertCursorAt(3, 3); +}, { value: '' }); +testVim('O', function(cm, vim, helpers) { + cm.setCursor(0, 4); + helpers.doKeys('O'); + eq('\nword1\nword2', cm.getValue()); + helpers.assertCursorAt(0, 0); + eq('vim-insert', cm.getOption('keyMap')); +}, { value: 'word1\nword2' }); +testVim('J', function(cm, vim, helpers) { + cm.setCursor(0, 4); + helpers.doKeys('J'); + var expectedValue = 'word1 word2\nword3\n word4'; + eq(expectedValue, cm.getValue()); + helpers.assertCursorAt(0, expectedValue.indexOf('word2') - 1); +}, { value: 'word1 \n word2\nword3\n word4' }); +testVim('J_repeat', function(cm, vim, helpers) { + cm.setCursor(0, 4); + helpers.doKeys('3', 'J'); + var expectedValue = 'word1 word2 word3\n word4'; + eq(expectedValue, cm.getValue()); + helpers.assertCursorAt(0, expectedValue.indexOf('word3') - 1); +}, { value: 'word1 \n word2\nword3\n word4' }); +testVim('p', function(cm, vim, helpers) { + cm.setCursor(0, 1); + helpers.getRegisterController().pushText('"', 'yank', 'abc\ndef', false); + helpers.doKeys('p'); + eq('__abc\ndef_', cm.getValue()); + helpers.assertCursorAt(1, 2); +}, { value: '___' }); +testVim('p_register', function(cm, vim, helpers) { + cm.setCursor(0, 1); + helpers.getRegisterController().getRegister('a').set('abc\ndef', false); + helpers.doKeys('"', 'a', 'p'); + eq('__abc\ndef_', cm.getValue()); + helpers.assertCursorAt(1, 2); +}, { value: '___' }); +testVim('p_wrong_register', function(cm, vim, helpers) { + cm.setCursor(0, 1); + helpers.getRegisterController().getRegister('a').set('abc\ndef', false); + helpers.doKeys('p'); + eq('___', cm.getValue()); + helpers.assertCursorAt(0, 1); +}, { value: '___' }); +testVim('p_line', function(cm, vim, helpers) { + cm.setCursor(0, 1); + helpers.getRegisterController().pushText('"', 'yank', ' a\nd\n', true); + helpers.doKeys('2', 'p'); + eq('___\n a\nd\n a\nd', cm.getValue()); + helpers.assertCursorAt(1, 2); +}, { value: '___' }); +testVim('P', function(cm, vim, helpers) { + cm.setCursor(0, 1); + helpers.getRegisterController().pushText('"', 'yank', 'abc\ndef', false); + helpers.doKeys('P'); + eq('_abc\ndef__', cm.getValue()); + helpers.assertCursorAt(1, 3); +}, { value: '___' }); +testVim('P_line', function(cm, vim, helpers) { + cm.setCursor(0, 1); + helpers.getRegisterController().pushText('"', 'yank', ' a\nd\n', true); + helpers.doKeys('2', 'P'); + eq(' a\nd\n a\nd\n___', cm.getValue()); + helpers.assertCursorAt(0, 2); +}, { value: '___' }); +testVim('r', function(cm, vim, helpers) { + cm.setCursor(0, 1); + helpers.doKeys('3', 'r', 'u'); + eq('wuuuet\nanother', cm.getValue(),'3r failed'); + helpers.assertCursorAt(0, 3); + cm.setCursor(0, 4); + helpers.doKeys('v', 'j', 'h', 'r', ''); + eq('wuuu \n her', cm.getValue(),'Replacing selection by space-characters failed'); +}, { value: 'wordet\nanother' }); +testVim('R', function(cm, vim, helpers) { + cm.setCursor(0, 1); + helpers.doKeys('R'); + helpers.assertCursorAt(0, 1); + eq('vim-replace', cm.getOption('keyMap')); + is(cm.state.overwrite, 'Setting overwrite state failed'); +}); +testVim('mark', function(cm, vim, helpers) { + cm.setCursor(2, 2); + helpers.doKeys('m', 't'); + cm.setCursor(0, 0); + helpers.doKeys('\'', 't'); + helpers.assertCursorAt(2, 2); + cm.setCursor(0, 0); + helpers.doKeys('`', 't'); + helpers.assertCursorAt(2, 2); +}); +testVim('jumpToMark_next', function(cm, vim, helpers) { + cm.setCursor(2, 2); + helpers.doKeys('m', 't'); + cm.setCursor(0, 0); + helpers.doKeys(']', '`'); + helpers.assertCursorAt(2, 2); + cm.setCursor(0, 0); + helpers.doKeys(']', '\''); + helpers.assertCursorAt(2, 0); +}); +testVim('jumpToMark_next_repeat', function(cm, vim, helpers) { + cm.setCursor(2, 2); + helpers.doKeys('m', 'a'); + cm.setCursor(3, 2); + helpers.doKeys('m', 'b'); + cm.setCursor(4, 2); + helpers.doKeys('m', 'c'); + cm.setCursor(0, 0); + helpers.doKeys('2', ']', '`'); + helpers.assertCursorAt(3, 2); + cm.setCursor(0, 0); + helpers.doKeys('2', ']', '\''); + helpers.assertCursorAt(3, 1); +}); +testVim('jumpToMark_next_sameline', function(cm, vim, helpers) { + cm.setCursor(2, 0); + helpers.doKeys('m', 'a'); + cm.setCursor(2, 4); + helpers.doKeys('m', 'b'); + cm.setCursor(2, 2); + helpers.doKeys(']', '`'); + helpers.assertCursorAt(2, 4); +}); +testVim('jumpToMark_next_onlyprev', function(cm, vim, helpers) { + cm.setCursor(2, 0); + helpers.doKeys('m', 'a'); + cm.setCursor(4, 0); + helpers.doKeys(']', '`'); + helpers.assertCursorAt(4, 0); +}); +testVim('jumpToMark_next_nomark', function(cm, vim, helpers) { + cm.setCursor(2, 2); + helpers.doKeys(']', '`'); + helpers.assertCursorAt(2, 2); + helpers.doKeys(']', '\''); + helpers.assertCursorAt(2, 0); +}); +testVim('jumpToMark_next_linewise_over', function(cm, vim, helpers) { + cm.setCursor(2, 2); + helpers.doKeys('m', 'a'); + cm.setCursor(3, 4); + helpers.doKeys('m', 'b'); + cm.setCursor(2, 1); + helpers.doKeys(']', '\''); + helpers.assertCursorAt(3, 1); +}); +testVim('jumpToMark_next_action', function(cm, vim, helpers) { + cm.setCursor(2, 2); + helpers.doKeys('m', 't'); + cm.setCursor(0, 0); + helpers.doKeys('d', ']', '`'); + helpers.assertCursorAt(0, 0); + var actual = cm.getLine(0); + var expected = 'pop pop 0 1 2 3 4'; + eq(actual, expected, "Deleting while jumping to the next mark failed."); +}); +testVim('jumpToMark_next_line_action', function(cm, vim, helpers) { + cm.setCursor(2, 2); + helpers.doKeys('m', 't'); + cm.setCursor(0, 0); + helpers.doKeys('d', ']', '\''); + helpers.assertCursorAt(0, 1); + var actual = cm.getLine(0); + var expected = ' (a) [b] {c} ' + eq(actual, expected, "Deleting while jumping to the next mark line failed."); +}); +testVim('jumpToMark_prev', function(cm, vim, helpers) { + cm.setCursor(2, 2); + helpers.doKeys('m', 't'); + cm.setCursor(4, 0); + helpers.doKeys('[', '`'); + helpers.assertCursorAt(2, 2); + cm.setCursor(4, 0); + helpers.doKeys('[', '\''); + helpers.assertCursorAt(2, 0); +}); +testVim('jumpToMark_prev_repeat', function(cm, vim, helpers) { + cm.setCursor(2, 2); + helpers.doKeys('m', 'a'); + cm.setCursor(3, 2); + helpers.doKeys('m', 'b'); + cm.setCursor(4, 2); + helpers.doKeys('m', 'c'); + cm.setCursor(5, 0); + helpers.doKeys('2', '[', '`'); + helpers.assertCursorAt(3, 2); + cm.setCursor(5, 0); + helpers.doKeys('2', '[', '\''); + helpers.assertCursorAt(3, 1); +}); +testVim('jumpToMark_prev_sameline', function(cm, vim, helpers) { + cm.setCursor(2, 0); + helpers.doKeys('m', 'a'); + cm.setCursor(2, 4); + helpers.doKeys('m', 'b'); + cm.setCursor(2, 2); + helpers.doKeys('[', '`'); + helpers.assertCursorAt(2, 0); +}); +testVim('jumpToMark_prev_onlynext', function(cm, vim, helpers) { + cm.setCursor(4, 4); + helpers.doKeys('m', 'a'); + cm.setCursor(2, 0); + helpers.doKeys('[', '`'); + helpers.assertCursorAt(2, 0); +}); +testVim('jumpToMark_prev_nomark', function(cm, vim, helpers) { + cm.setCursor(2, 2); + helpers.doKeys('[', '`'); + helpers.assertCursorAt(2, 2); + helpers.doKeys('[', '\''); + helpers.assertCursorAt(2, 0); +}); +testVim('jumpToMark_prev_linewise_over', function(cm, vim, helpers) { + cm.setCursor(2, 2); + helpers.doKeys('m', 'a'); + cm.setCursor(3, 4); + helpers.doKeys('m', 'b'); + cm.setCursor(3, 6); + helpers.doKeys('[', '\''); + helpers.assertCursorAt(2, 0); +}); +testVim('delmark_single', function(cm, vim, helpers) { + cm.setCursor(1, 2); + helpers.doKeys('m', 't'); + helpers.doEx('delmarks t'); + cm.setCursor(0, 0); + helpers.doKeys('`', 't'); + helpers.assertCursorAt(0, 0); +}); +testVim('delmark_range', function(cm, vim, helpers) { + cm.setCursor(1, 2); + helpers.doKeys('m', 'a'); + cm.setCursor(2, 2); + helpers.doKeys('m', 'b'); + cm.setCursor(3, 2); + helpers.doKeys('m', 'c'); + cm.setCursor(4, 2); + helpers.doKeys('m', 'd'); + cm.setCursor(5, 2); + helpers.doKeys('m', 'e'); + helpers.doEx('delmarks b-d'); + cm.setCursor(0, 0); + helpers.doKeys('`', 'a'); + helpers.assertCursorAt(1, 2); + helpers.doKeys('`', 'b'); + helpers.assertCursorAt(1, 2); + helpers.doKeys('`', 'c'); + helpers.assertCursorAt(1, 2); + helpers.doKeys('`', 'd'); + helpers.assertCursorAt(1, 2); + helpers.doKeys('`', 'e'); + helpers.assertCursorAt(5, 2); +}); +testVim('delmark_multi', function(cm, vim, helpers) { + cm.setCursor(1, 2); + helpers.doKeys('m', 'a'); + cm.setCursor(2, 2); + helpers.doKeys('m', 'b'); + cm.setCursor(3, 2); + helpers.doKeys('m', 'c'); + cm.setCursor(4, 2); + helpers.doKeys('m', 'd'); + cm.setCursor(5, 2); + helpers.doKeys('m', 'e'); + helpers.doEx('delmarks bcd'); + cm.setCursor(0, 0); + helpers.doKeys('`', 'a'); + helpers.assertCursorAt(1, 2); + helpers.doKeys('`', 'b'); + helpers.assertCursorAt(1, 2); + helpers.doKeys('`', 'c'); + helpers.assertCursorAt(1, 2); + helpers.doKeys('`', 'd'); + helpers.assertCursorAt(1, 2); + helpers.doKeys('`', 'e'); + helpers.assertCursorAt(5, 2); +}); +testVim('delmark_multi_space', function(cm, vim, helpers) { + cm.setCursor(1, 2); + helpers.doKeys('m', 'a'); + cm.setCursor(2, 2); + helpers.doKeys('m', 'b'); + cm.setCursor(3, 2); + helpers.doKeys('m', 'c'); + cm.setCursor(4, 2); + helpers.doKeys('m', 'd'); + cm.setCursor(5, 2); + helpers.doKeys('m', 'e'); + helpers.doEx('delmarks b c d'); + cm.setCursor(0, 0); + helpers.doKeys('`', 'a'); + helpers.assertCursorAt(1, 2); + helpers.doKeys('`', 'b'); + helpers.assertCursorAt(1, 2); + helpers.doKeys('`', 'c'); + helpers.assertCursorAt(1, 2); + helpers.doKeys('`', 'd'); + helpers.assertCursorAt(1, 2); + helpers.doKeys('`', 'e'); + helpers.assertCursorAt(5, 2); +}); +testVim('delmark_all', function(cm, vim, helpers) { + cm.setCursor(1, 2); + helpers.doKeys('m', 'a'); + cm.setCursor(2, 2); + helpers.doKeys('m', 'b'); + cm.setCursor(3, 2); + helpers.doKeys('m', 'c'); + cm.setCursor(4, 2); + helpers.doKeys('m', 'd'); + cm.setCursor(5, 2); + helpers.doKeys('m', 'e'); + helpers.doEx('delmarks a b-de'); + cm.setCursor(0, 0); + helpers.doKeys('`', 'a'); + helpers.assertCursorAt(0, 0); + helpers.doKeys('`', 'b'); + helpers.assertCursorAt(0, 0); + helpers.doKeys('`', 'c'); + helpers.assertCursorAt(0, 0); + helpers.doKeys('`', 'd'); + helpers.assertCursorAt(0, 0); + helpers.doKeys('`', 'e'); + helpers.assertCursorAt(0, 0); +}); +testVim('visual', function(cm, vim, helpers) { + helpers.doKeys('l', 'v', 'l', 'l'); + helpers.assertCursorAt(0, 3); + eqPos(makeCursor(0, 1), cm.getCursor('anchor')); + helpers.doKeys('d'); + eq('15', cm.getValue()); +}, { value: '12345' }); +testVim('visual_line', function(cm, vim, helpers) { + helpers.doKeys('l', 'V', 'l', 'j', 'j', 'd'); + eq(' 4\n 5', cm.getValue()); +}, { value: ' 1\n 2\n 3\n 4\n 5' }); +testVim('visual_marks', function(cm, vim, helpers) { + helpers.doKeys('l', 'v', 'l', 'l', 'v'); + // Test visual mode marks + cm.setCursor(0, 0); + helpers.doKeys('\'', '<'); + helpers.assertCursorAt(0, 1); + helpers.doKeys('\'', '>'); + helpers.assertCursorAt(0, 3); +}); +testVim('visual_join', function(cm, vim, helpers) { + helpers.doKeys('l', 'V', 'l', 'j', 'j', 'J'); + eq(' 1 2 3\n 4\n 5', cm.getValue()); +}, { value: ' 1\n 2\n 3\n 4\n 5' }); +testVim('/ and n/N', function(cm, vim, helpers) { + cm.openDialog = helpers.fakeOpenDialog('match'); + helpers.doKeys('/'); + helpers.assertCursorAt(0, 11); + helpers.doKeys('n'); + helpers.assertCursorAt(1, 6); + helpers.doKeys('N'); + helpers.assertCursorAt(0, 11); + + cm.setCursor(0, 0); + helpers.doKeys('2', '/'); + helpers.assertCursorAt(1, 6); +}, { value: 'match nope match \n nope Match' }); +testVim('/_case', function(cm, vim, helpers) { + cm.openDialog = helpers.fakeOpenDialog('Match'); + helpers.doKeys('/'); + helpers.assertCursorAt(1, 6); +}, { value: 'match nope match \n nope Match' }); +testVim('/_nongreedy', function(cm, vim, helpers) { + cm.openDialog = helpers.fakeOpenDialog('aa'); + helpers.doKeys('/'); + helpers.assertCursorAt(0, 4); + helpers.doKeys('n'); + helpers.assertCursorAt(1, 3); + helpers.doKeys('n'); + helpers.assertCursorAt(0, 0); +}, { value: 'aaa aa \n a aa'}); +testVim('?_nongreedy', function(cm, vim, helpers) { + cm.openDialog = helpers.fakeOpenDialog('aa'); + helpers.doKeys('?'); + helpers.assertCursorAt(1, 3); + helpers.doKeys('n'); + helpers.assertCursorAt(0, 4); + helpers.doKeys('n'); + helpers.assertCursorAt(0, 0); +}, { value: 'aaa aa \n a aa'}); +testVim('/_greedy', function(cm, vim, helpers) { + cm.openDialog = helpers.fakeOpenDialog('a+'); + helpers.doKeys('/'); + helpers.assertCursorAt(0, 4); + helpers.doKeys('n'); + helpers.assertCursorAt(1, 1); + helpers.doKeys('n'); + helpers.assertCursorAt(1, 3); + helpers.doKeys('n'); + helpers.assertCursorAt(0, 0); +}, { value: 'aaa aa \n a aa'}); +testVim('?_greedy', function(cm, vim, helpers) { + cm.openDialog = helpers.fakeOpenDialog('a+'); + helpers.doKeys('?'); + helpers.assertCursorAt(1, 3); + helpers.doKeys('n'); + helpers.assertCursorAt(1, 1); + helpers.doKeys('n'); + helpers.assertCursorAt(0, 4); + helpers.doKeys('n'); + helpers.assertCursorAt(0, 0); +}, { value: 'aaa aa \n a aa'}); +testVim('/_greedy_0_or_more', function(cm, vim, helpers) { + cm.openDialog = helpers.fakeOpenDialog('a*'); + helpers.doKeys('/'); + helpers.assertCursorAt(0, 3); + helpers.doKeys('n'); + helpers.assertCursorAt(0, 4); + helpers.doKeys('n'); + helpers.assertCursorAt(0, 5); + helpers.doKeys('n'); + helpers.assertCursorAt(1, 0); + helpers.doKeys('n'); + helpers.assertCursorAt(1, 1); + helpers.doKeys('n'); + helpers.assertCursorAt(0, 0); +}, { value: 'aaa aa\n aa'}); +testVim('?_greedy_0_or_more', function(cm, vim, helpers) { + cm.openDialog = helpers.fakeOpenDialog('a*'); + helpers.doKeys('?'); + helpers.assertCursorAt(1, 1); + helpers.doKeys('n'); + helpers.assertCursorAt(1, 0); + helpers.doKeys('n'); + helpers.assertCursorAt(0, 5); + helpers.doKeys('n'); + helpers.assertCursorAt(0, 4); + helpers.doKeys('n'); + helpers.assertCursorAt(0, 3); + helpers.doKeys('n'); + helpers.assertCursorAt(0, 0); +}, { value: 'aaa aa\n aa'}); +testVim('? and n/N', function(cm, vim, helpers) { + cm.openDialog = helpers.fakeOpenDialog('match'); + helpers.doKeys('?'); + helpers.assertCursorAt(1, 6); + helpers.doKeys('n'); + helpers.assertCursorAt(0, 11); + helpers.doKeys('N'); + helpers.assertCursorAt(1, 6); + + cm.setCursor(0, 0); + helpers.doKeys('2', '?'); + helpers.assertCursorAt(0, 11); +}, { value: 'match nope match \n nope Match' }); +testVim('*', function(cm, vim, helpers) { + cm.setCursor(0, 9); + helpers.doKeys('*'); + helpers.assertCursorAt(0, 22); + + cm.setCursor(0, 9); + helpers.doKeys('2', '*'); + helpers.assertCursorAt(1, 8); +}, { value: 'nomatch match nomatch match \nnomatch Match' }); +testVim('*_no_word', function(cm, vim, helpers) { + cm.setCursor(0, 0); + helpers.doKeys('*'); + helpers.assertCursorAt(0, 0); +}, { value: ' \n match \n' }); +testVim('*_symbol', function(cm, vim, helpers) { + cm.setCursor(0, 0); + helpers.doKeys('*'); + helpers.assertCursorAt(1, 0); +}, { value: ' /}\n/} match \n' }); +testVim('#', function(cm, vim, helpers) { + cm.setCursor(0, 9); + helpers.doKeys('#'); + helpers.assertCursorAt(1, 8); + + cm.setCursor(0, 9); + helpers.doKeys('2', '#'); + helpers.assertCursorAt(0, 22); +}, { value: 'nomatch match nomatch match \nnomatch Match' }); +testVim('*_seek', function(cm, vim, helpers) { + // Should skip over space and symbols. + cm.setCursor(0, 3); + helpers.doKeys('*'); + helpers.assertCursorAt(0, 22); +}, { value: ' := match nomatch match \nnomatch Match' }); +testVim('#', function(cm, vim, helpers) { + // Should skip over space and symbols. + cm.setCursor(0, 3); + helpers.doKeys('#'); + helpers.assertCursorAt(1, 8); +}, { value: ' := match nomatch match \nnomatch Match' }); +testVim('.', function(cm, vim, helpers) { + cm.setCursor(0, 0); + helpers.doKeys('2', 'd', 'w'); + helpers.doKeys('.'); + eq('5 6', cm.getValue()); +}, { value: '1 2 3 4 5 6'}); +testVim('._repeat', function(cm, vim, helpers) { + cm.setCursor(0, 0); + helpers.doKeys('2', 'd', 'w'); + helpers.doKeys('3', '.'); + eq('6', cm.getValue()); +}, { value: '1 2 3 4 5 6'}); +testVim('._insert', function(cm, vim, helpers) { + helpers.doKeys('i'); + cm.replaceRange('test', cm.getCursor()); + helpers.doInsertModeKeys('Esc'); + helpers.doKeys('.'); + eq('testestt', cm.getValue()); + helpers.assertCursorAt(0, 6); +}, { value: ''}); +testVim('._insert_repeat', function(cm, vim, helpers) { + helpers.doKeys('i'); + cm.replaceRange('test', cm.getCursor()); + cm.setCursor(0, 4); + helpers.doInsertModeKeys('Esc'); + helpers.doKeys('2', '.'); + eq('testesttestt', cm.getValue()); + helpers.assertCursorAt(0, 10); +}, { value: ''}); +testVim('._repeat_insert', function(cm, vim, helpers) { + helpers.doKeys('3', 'i'); + cm.replaceRange('te', cm.getCursor()); + cm.setCursor(0, 2); + helpers.doInsertModeKeys('Esc'); + helpers.doKeys('.'); + eq('tetettetetee', cm.getValue()); + helpers.assertCursorAt(0, 10); +}, { value: ''}); +testVim('._insert_o', function(cm, vim, helpers) { + helpers.doKeys('o'); + cm.replaceRange('z', cm.getCursor()); + cm.setCursor(1, 1); + helpers.doInsertModeKeys('Esc'); + helpers.doKeys('.'); + eq('\nz\nz', cm.getValue()); + helpers.assertCursorAt(2, 0); +}, { value: ''}); +testVim('._insert_o_repeat', function(cm, vim, helpers) { + helpers.doKeys('o'); + cm.replaceRange('z', cm.getCursor()); + helpers.doInsertModeKeys('Esc'); + cm.setCursor(1, 0); + helpers.doKeys('2', '.'); + eq('\nz\nz\nz', cm.getValue()); + helpers.assertCursorAt(3, 0); +}, { value: ''}); +testVim('._insert_o_indent', function(cm, vim, helpers) { + helpers.doKeys('o'); + cm.replaceRange('z', cm.getCursor()); + helpers.doInsertModeKeys('Esc'); + cm.setCursor(1, 2); + helpers.doKeys('.'); + eq('{\n z\n z', cm.getValue()); + helpers.assertCursorAt(2, 2); +}, { value: '{'}); +testVim('._insert_cw', function(cm, vim, helpers) { + helpers.doKeys('c', 'w'); + cm.replaceRange('test', cm.getCursor()); + helpers.doInsertModeKeys('Esc'); + cm.setCursor(0, 3); + helpers.doKeys('2', 'l'); + helpers.doKeys('.'); + eq('test test word3', cm.getValue()); + helpers.assertCursorAt(0, 8); +}, { value: 'word1 word2 word3' }); +testVim('._insert_cw_repeat', function(cm, vim, helpers) { + // For some reason, repeat cw in desktop VIM will does not repeat insert mode + // changes. Will conform to that behavior. + helpers.doKeys('c', 'w'); + cm.replaceRange('test', cm.getCursor()); + helpers.doInsertModeKeys('Esc'); + cm.setCursor(0, 4); + helpers.doKeys('l'); + helpers.doKeys('2', '.'); + eq('test test', cm.getValue()); + helpers.assertCursorAt(0, 8); +}, { value: 'word1 word2 word3' }); +testVim('._delete', function(cm, vim, helpers) { + cm.setCursor(0, 5); + helpers.doKeys('i'); + helpers.doInsertModeKeys('Backspace', 'Esc'); + helpers.doKeys('.'); + eq('zace', cm.getValue()); + helpers.assertCursorAt(0, 1); +}, { value: 'zabcde'}); +testVim('._delete_repeat', function(cm, vim, helpers) { + cm.setCursor(0, 6); + helpers.doKeys('i'); + helpers.doInsertModeKeys('Backspace', 'Esc'); + helpers.doKeys('2', '.'); + eq('zzce', cm.getValue()); + helpers.assertCursorAt(0, 1); +}, { value: 'zzabcde'}); +testVim('f;', function(cm, vim, helpers) { + cm.setCursor(0, 0); + helpers.doKeys('f', 'x'); + helpers.doKeys(';'); + helpers.doKeys('2', ';'); + eq(9, cm.getCursor().ch); +}, { value: '01x3xx678x'}); +testVim('F;', function(cm, vim, helpers) { + cm.setCursor(0, 8); + helpers.doKeys('F', 'x'); + helpers.doKeys(';'); + helpers.doKeys('2', ';'); + eq(2, cm.getCursor().ch); +}, { value: '01x3xx6x8x'}); +testVim('t;', function(cm, vim, helpers) { + cm.setCursor(0, 0); + helpers.doKeys('t', 'x'); + helpers.doKeys(';'); + helpers.doKeys('2', ';'); + eq(8, cm.getCursor().ch); +}, { value: '01x3xx678x'}); +testVim('T;', function(cm, vim, helpers) { + cm.setCursor(0, 9); + helpers.doKeys('T', 'x'); + helpers.doKeys(';'); + helpers.doKeys('2', ';'); + eq(2, cm.getCursor().ch); +}, { value: '0xx3xx678x'}); +testVim('f,', function(cm, vim, helpers) { + cm.setCursor(0, 6); + helpers.doKeys('f', 'x'); + helpers.doKeys(','); + helpers.doKeys('2', ','); + eq(2, cm.getCursor().ch); +}, { value: '01x3xx678x'}); +testVim('F,', function(cm, vim, helpers) { + cm.setCursor(0, 3); + helpers.doKeys('F', 'x'); + helpers.doKeys(','); + helpers.doKeys('2', ','); + eq(9, cm.getCursor().ch); +}, { value: '01x3xx678x'}); +testVim('t,', function(cm, vim, helpers) { + cm.setCursor(0, 6); + helpers.doKeys('t', 'x'); + helpers.doKeys(','); + helpers.doKeys('2', ','); + eq(3, cm.getCursor().ch); +}, { value: '01x3xx678x'}); +testVim('T,', function(cm, vim, helpers) { + cm.setCursor(0, 4); + helpers.doKeys('T', 'x'); + helpers.doKeys(','); + helpers.doKeys('2', ','); + eq(8, cm.getCursor().ch); +}, { value: '01x3xx67xx'}); +testVim('fd,;', function(cm, vim, helpers) { + cm.setCursor(0, 0); + helpers.doKeys('f', '4'); + cm.setCursor(0, 0); + helpers.doKeys('d', ';'); + eq('56789', cm.getValue()); + helpers.doKeys('u'); + cm.setCursor(0, 9); + helpers.doKeys('d', ','); + eq('01239', cm.getValue()); +}, { value: '0123456789'}); +testVim('Fd,;', function(cm, vim, helpers) { + cm.setCursor(0, 9); + helpers.doKeys('F', '4'); + cm.setCursor(0, 9); + helpers.doKeys('d', ';'); + eq('01239', cm.getValue()); + helpers.doKeys('u'); + cm.setCursor(0, 0); + helpers.doKeys('d', ','); + eq('56789', cm.getValue()); +}, { value: '0123456789'}); +testVim('td,;', function(cm, vim, helpers) { + cm.setCursor(0, 0); + helpers.doKeys('t', '4'); + cm.setCursor(0, 0); + helpers.doKeys('d', ';'); + eq('456789', cm.getValue()); + helpers.doKeys('u'); + cm.setCursor(0, 9); + helpers.doKeys('d', ','); + eq('012349', cm.getValue()); +}, { value: '0123456789'}); +testVim('Td,;', function(cm, vim, helpers) { + cm.setCursor(0, 9); + helpers.doKeys('T', '4'); + cm.setCursor(0, 9); + helpers.doKeys('d', ';'); + eq('012349', cm.getValue()); + helpers.doKeys('u'); + cm.setCursor(0, 0); + helpers.doKeys('d', ','); + eq('456789', cm.getValue()); +}, { value: '0123456789'}); +testVim('fc,;', function(cm, vim, helpers) { + cm.setCursor(0, 0); + helpers.doKeys('f', '4'); + cm.setCursor(0, 0); + helpers.doKeys('c', ';', 'Esc'); + eq('56789', cm.getValue()); + helpers.doKeys('u'); + cm.setCursor(0, 9); + helpers.doKeys('c', ','); + eq('01239', cm.getValue()); +}, { value: '0123456789'}); +testVim('Fc,;', function(cm, vim, helpers) { + cm.setCursor(0, 9); + helpers.doKeys('F', '4'); + cm.setCursor(0, 9); + helpers.doKeys('c', ';', 'Esc'); + eq('01239', cm.getValue()); + helpers.doKeys('u'); + cm.setCursor(0, 0); + helpers.doKeys('c', ','); + eq('56789', cm.getValue()); +}, { value: '0123456789'}); +testVim('tc,;', function(cm, vim, helpers) { + cm.setCursor(0, 0); + helpers.doKeys('t', '4'); + cm.setCursor(0, 0); + helpers.doKeys('c', ';', 'Esc'); + eq('456789', cm.getValue()); + helpers.doKeys('u'); + cm.setCursor(0, 9); + helpers.doKeys('c', ','); + eq('012349', cm.getValue()); +}, { value: '0123456789'}); +testVim('Tc,;', function(cm, vim, helpers) { + cm.setCursor(0, 9); + helpers.doKeys('T', '4'); + cm.setCursor(0, 9); + helpers.doKeys('c', ';', 'Esc'); + eq('012349', cm.getValue()); + helpers.doKeys('u'); + cm.setCursor(0, 0); + helpers.doKeys('c', ','); + eq('456789', cm.getValue()); +}, { value: '0123456789'}); +testVim('fy,;', function(cm, vim, helpers) { + cm.setCursor(0, 0); + helpers.doKeys('f', '4'); + cm.setCursor(0, 0); + helpers.doKeys('y', ';', 'P'); + eq('012340123456789', cm.getValue()); + helpers.doKeys('u'); + cm.setCursor(0, 9); + helpers.doKeys('y', ',', 'P'); + eq('012345678456789', cm.getValue()); +}, { value: '0123456789'}); +testVim('Fy,;', function(cm, vim, helpers) { + cm.setCursor(0, 9); + helpers.doKeys('F', '4'); + cm.setCursor(0, 9); + helpers.doKeys('y', ';', 'p'); + eq('012345678945678', cm.getValue()); + helpers.doKeys('u'); + cm.setCursor(0, 0); + helpers.doKeys('y', ',', 'P'); + eq('012340123456789', cm.getValue()); +}, { value: '0123456789'}); +testVim('ty,;', function(cm, vim, helpers) { + cm.setCursor(0, 0); + helpers.doKeys('t', '4'); + cm.setCursor(0, 0); + helpers.doKeys('y', ';', 'P'); + eq('01230123456789', cm.getValue()); + helpers.doKeys('u'); + cm.setCursor(0, 9); + helpers.doKeys('y', ',', 'p'); + eq('01234567895678', cm.getValue()); +}, { value: '0123456789'}); +testVim('Ty,;', function(cm, vim, helpers) { + cm.setCursor(0, 9); + helpers.doKeys('T', '4'); + cm.setCursor(0, 9); + helpers.doKeys('y', ';', 'p'); + eq('01234567895678', cm.getValue()); + helpers.doKeys('u'); + cm.setCursor(0, 0); + helpers.doKeys('y', ',', 'P'); + eq('01230123456789', cm.getValue()); +}, { value: '0123456789'}); +testVim('HML', function(cm, vim, helpers) { + var lines = 35; + var textHeight = cm.defaultTextHeight(); + cm.setSize(600, lines*textHeight); + cm.setCursor(120, 0); + helpers.doKeys('H'); + helpers.assertCursorAt(86, 2); + helpers.doKeys('L'); + helpers.assertCursorAt(120, 4); + helpers.doKeys('M'); + helpers.assertCursorAt(103,4); +}, { value: (function(){ + var lines = new Array(100); + var upper = ' xx\n'; + var lower = ' xx\n'; + upper = lines.join(upper); + lower = lines.join(lower); + return upper + lower; +})()}); + +var zVals = ['zb','zz','zt','z-','z.','z'].map(function(e, idx){ + var lineNum = 250; + var lines = 35; + testVim(e, function(cm, vim, helpers) { + var k1 = e[0]; + var k2 = e.substring(1); + var textHeight = cm.defaultTextHeight(); + cm.setSize(600, lines*textHeight); + cm.setCursor(lineNum, 0); + helpers.doKeys(k1, k2); + zVals[idx] = cm.getScrollInfo().top; + }, { value: (function(){ + return new Array(500).join('\n'); + })()}); +}); +testVim('zb', function(cm, vim, helpers){ + eq(zVals[2], zVals[5]); +}); + +var squareBracketMotionSandbox = ''+ + '({\n'+//0 + ' ({\n'+//11 + ' /*comment {\n'+//2 + ' */(\n'+//3 + '#else \n'+//4 + ' /* )\n'+//5 + '#if }\n'+//6 + ' )}*/\n'+//7 + ')}\n'+//8 + '{}\n'+//9 + '#else {{\n'+//10 + '{}\n'+//11 + '}\n'+//12 + '{\n'+//13 + '#endif\n'+//14 + '}\n'+//15 + '}\n'+//16 + '#else';//17 +testVim('[[, ]]', function(cm, vim, helpers) { + cm.setCursor(0, 0); + helpers.doKeys(']', ']'); + helpers.assertCursorAt(9,0); + helpers.doKeys('2', ']', ']'); + helpers.assertCursorAt(13,0); + helpers.doKeys(']', ']'); + helpers.assertCursorAt(17,0); + helpers.doKeys('[', '['); + helpers.assertCursorAt(13,0); + helpers.doKeys('2', '[', '['); + helpers.assertCursorAt(9,0); + helpers.doKeys('[', '['); + helpers.assertCursorAt(0,0); +}, { value: squareBracketMotionSandbox}); +testVim('[], ][', function(cm, vim, helpers) { + cm.setCursor(0, 0); + helpers.doKeys(']', '['); + helpers.assertCursorAt(12,0); + helpers.doKeys('2', ']', '['); + helpers.assertCursorAt(16,0); + helpers.doKeys(']', '['); + helpers.assertCursorAt(17,0); + helpers.doKeys('[', ']'); + helpers.assertCursorAt(16,0); + helpers.doKeys('2', '[', ']'); + helpers.assertCursorAt(12,0); + helpers.doKeys('[', ']'); + helpers.assertCursorAt(0,0); +}, { value: squareBracketMotionSandbox}); +testVim('[{, ]}', function(cm, vim, helpers) { + cm.setCursor(4, 10); + helpers.doKeys('[', '{'); + helpers.assertCursorAt(2,12); + helpers.doKeys('2', '[', '{'); + helpers.assertCursorAt(0,1); + cm.setCursor(4, 10); + helpers.doKeys(']', '}'); + helpers.assertCursorAt(6,11); + helpers.doKeys('2', ']', '}'); + helpers.assertCursorAt(8,1); + cm.setCursor(0,1); + helpers.doKeys(']', '}'); + helpers.assertCursorAt(8,1); + helpers.doKeys('[', '{'); + helpers.assertCursorAt(0,1); +}, { value: squareBracketMotionSandbox}); +testVim('[(, ])', function(cm, vim, helpers) { + cm.setCursor(4, 10); + helpers.doKeys('[', '('); + helpers.assertCursorAt(3,14); + helpers.doKeys('2', '[', '('); + helpers.assertCursorAt(0,0); + cm.setCursor(4, 10); + helpers.doKeys(']', ')'); + helpers.assertCursorAt(5,11); + helpers.doKeys('2', ']', ')'); + helpers.assertCursorAt(8,0); + helpers.doKeys('[', '('); + helpers.assertCursorAt(0,0); + helpers.doKeys(']', ')'); + helpers.assertCursorAt(8,0); +}, { value: squareBracketMotionSandbox}); +testVim('[*, ]*, [/, ]/', function(cm, vim, helpers) { + ['*', '/'].forEach(function(key){ + cm.setCursor(7, 0); + helpers.doKeys('2', '[', key); + helpers.assertCursorAt(2,2); + helpers.doKeys('2', ']', key); + helpers.assertCursorAt(7,5); + }); +}, { value: squareBracketMotionSandbox}); +testVim('[#, ]#', function(cm, vim, helpers) { + cm.setCursor(10, 3); + helpers.doKeys('2', '[', '#'); + helpers.assertCursorAt(4,0); + helpers.doKeys('5', ']', '#'); + helpers.assertCursorAt(17,0); + cm.setCursor(10, 3); + helpers.doKeys(']', '#'); + helpers.assertCursorAt(14,0); +}, { value: squareBracketMotionSandbox}); +testVim('[m, ]m, [M, ]M', function(cm, vim, helpers) { + cm.setCursor(11, 0); + helpers.doKeys('[', 'm'); + helpers.assertCursorAt(10,7); + helpers.doKeys('4', '[', 'm'); + helpers.assertCursorAt(1,3); + helpers.doKeys('5', ']', 'm'); + helpers.assertCursorAt(11,0); + helpers.doKeys('[', 'M'); + helpers.assertCursorAt(9,1); + helpers.doKeys('3', ']', 'M'); + helpers.assertCursorAt(15,0); + helpers.doKeys('5', '[', 'M'); + helpers.assertCursorAt(7,3); +}, { value: squareBracketMotionSandbox}); + +// Ex mode tests +testVim('ex_go_to_line', function(cm, vim, helpers) { + cm.setCursor(0, 0); + helpers.doEx('4'); + helpers.assertCursorAt(3, 0); +}, { value: 'a\nb\nc\nd\ne\n'}); +testVim('ex_write', function(cm, vim, helpers) { + var tmp = CodeMirror.commands.save; + var written; + var actualCm; + CodeMirror.commands.save = function(cm) { + written = true; + actualCm = cm; + }; + // Test that w, wr, wri ... write all trigger :write. + var command = 'write'; + for (var i = 1; i < command.length; i++) { + written = false; + actualCm = null; + helpers.doEx(command.substring(0, i)); + eq(written, true); + eq(actualCm, cm); + } + CodeMirror.commands.save = tmp; +}); +testVim('ex_sort', function(cm, vim, helpers) { + helpers.doEx('sort'); + eq('Z\na\nb\nc\nd', cm.getValue()); +}, { value: 'b\nZ\nd\nc\na'}); +testVim('ex_sort_reverse', function(cm, vim, helpers) { + helpers.doEx('sort!'); + eq('d\nc\nb\na', cm.getValue()); +}, { value: 'b\nd\nc\na'}); +testVim('ex_sort_range', function(cm, vim, helpers) { + helpers.doEx('2,3sort'); + eq('b\nc\nd\na', cm.getValue()); +}, { value: 'b\nd\nc\na'}); +testVim('ex_sort_oneline', function(cm, vim, helpers) { + helpers.doEx('2sort'); + // Expect no change. + eq('b\nd\nc\na', cm.getValue()); +}, { value: 'b\nd\nc\na'}); +testVim('ex_sort_ignoreCase', function(cm, vim, helpers) { + helpers.doEx('sort i'); + eq('a\nb\nc\nd\nZ', cm.getValue()); +}, { value: 'b\nZ\nd\nc\na'}); +testVim('ex_sort_unique', function(cm, vim, helpers) { + helpers.doEx('sort u'); + eq('Z\na\nb\nc\nd', cm.getValue()); +}, { value: 'b\nZ\na\na\nd\na\nc\na'}); +testVim('ex_sort_decimal', function(cm, vim, helpers) { + helpers.doEx('sort d'); + eq('d3\n s5\n6\n.9', cm.getValue()); +}, { value: '6\nd3\n s5\n.9'}); +testVim('ex_sort_decimal_negative', function(cm, vim, helpers) { + helpers.doEx('sort d'); + eq('z-9\nd3\n s5\n6\n.9', cm.getValue()); +}, { value: '6\nd3\n s5\n.9\nz-9'}); +testVim('ex_sort_decimal_reverse', function(cm, vim, helpers) { + helpers.doEx('sort! d'); + eq('.9\n6\n s5\nd3', cm.getValue()); +}, { value: '6\nd3\n s5\n.9'}); +testVim('ex_sort_hex', function(cm, vim, helpers) { + helpers.doEx('sort x'); + eq(' s5\n6\n.9\n&0xB\nd3', cm.getValue()); +}, { value: '6\nd3\n s5\n&0xB\n.9'}); +testVim('ex_sort_octal', function(cm, vim, helpers) { + helpers.doEx('sort o'); + eq('.8\n.9\nd3\n s5\n6', cm.getValue()); +}, { value: '6\nd3\n s5\n.9\n.8'}); +testVim('ex_sort_decimal_mixed', function(cm, vim, helpers) { + helpers.doEx('sort d'); + eq('y\nz\nc1\nb2\na3', cm.getValue()); +}, { value: 'a3\nz\nc1\ny\nb2'}); +testVim('ex_sort_decimal_mixed_reverse', function(cm, vim, helpers) { + helpers.doEx('sort! d'); + eq('a3\nb2\nc1\nz\ny', cm.getValue()); +}, { value: 'a3\nz\nc1\ny\nb2'}); +testVim('ex_substitute_same_line', function(cm, vim, helpers) { + cm.setCursor(1, 0); + helpers.doEx('s/one/two'); + eq('one one\n two two', cm.getValue()); +}, { value: 'one one\n one one'}); +testVim('ex_substitute_global', function(cm, vim, helpers) { + cm.setCursor(1, 0); + helpers.doEx('%s/one/two'); + eq('two two\n two two', cm.getValue()); +}, { value: 'one one\n one one'}); +testVim('ex_substitute_input_range', function(cm, vim, helpers) { + cm.setCursor(1, 0); + helpers.doEx('1,3s/\\d/0'); + eq('0\n0\n0\n4', cm.getValue()); +}, { value: '1\n2\n3\n4' }); +testVim('ex_substitute_visual_range', function(cm, vim, helpers) { + cm.setCursor(1, 0); + // Set last visual mode selection marks '< and '> at lines 2 and 4 + helpers.doKeys('V', '2', 'j', 'v'); + helpers.doEx('\'<,\'>s/\\d/0'); + eq('1\n0\n0\n0\n5', cm.getValue()); +}, { value: '1\n2\n3\n4\n5' }); +testVim('ex_substitute_capture', function(cm, vim, helpers) { + cm.setCursor(1, 0); + helpers.doEx('s/(\\d+)/$1$1/') + eq('a1111 a1212 a1313', cm.getValue()); +}, { value: 'a11 a12 a13' }); +testVim('ex_substitute_empty_query', function(cm, vim, helpers) { + // If the query is empty, use last query. + cm.setCursor(1, 0); + cm.openDialog = helpers.fakeOpenDialog('1'); + helpers.doKeys('/'); + helpers.doEx('s//b'); + eq('abb ab2 ab3', cm.getValue()); +}, { value: 'a11 a12 a13' }); +testVim('ex_substitute_count', function(cm, vim, helpers) { + cm.setCursor(1, 0); + helpers.doEx('s/\\d/0/i 2'); + eq('1\n0\n0\n4', cm.getValue()); +}, { value: '1\n2\n3\n4' }); +testVim('ex_substitute_count_with_range', function(cm, vim, helpers) { + cm.setCursor(1, 0); + helpers.doEx('1,3s/\\d/0/ 3'); + eq('1\n2\n0\n0', cm.getValue()); +}, { value: '1\n2\n3\n4' }); +function testSubstituteConfirm(name, command, initialValue, expectedValue, keys, finalPos) { + testVim(name, function(cm, vim, helpers) { + var savedOpenDialog = cm.openDialog; + var savedKeyName = CodeMirror.keyName; + var onKeyDown; + var recordedCallback; + var closed = true; // Start out closed, set false on second openDialog. + function close() { + closed = true; + } + // First openDialog should save callback. + cm.openDialog = function(template, callback, options) { + recordedCallback = callback; + } + // Do first openDialog. + helpers.doKeys(':'); + // Second openDialog should save keyDown handler. + cm.openDialog = function(template, callback, options) { + onKeyDown = options.onKeyDown; + closed = false; + }; + // Return the command to Vim and trigger second openDialog. + recordedCallback(command); + // The event should really use keyCode, but here just mock it out and use + // key and replace keyName to just return key. + CodeMirror.keyName = function (e) { return e.key; } + keys = keys.toUpperCase(); + for (var i = 0; i < keys.length; i++) { + is(!closed); + onKeyDown({ key: keys.charAt(i) }, '', close); + } + try { + eq(expectedValue, cm.getValue()); + helpers.assertCursorAt(finalPos); + is(closed); + } catch(e) { + throw e + } finally { + // Restore overriden functions. + CodeMirror.keyName = savedKeyName; + cm.openDialog = savedOpenDialog; + } + }, { value: initialValue }); +}; +testSubstituteConfirm('ex_substitute_confirm_emptydoc', + '%s/x/b/c', '', '', '', makeCursor(0, 0)); +testSubstituteConfirm('ex_substitute_confirm_nomatch', + '%s/x/b/c', 'ba a\nbab', 'ba a\nbab', '', makeCursor(0, 0)); +testSubstituteConfirm('ex_substitute_confirm_accept', + '%s/a/b/c', 'ba a\nbab', 'bb b\nbbb', 'yyy', makeCursor(1, 1)); +testSubstituteConfirm('ex_substitute_confirm_random_keys', + '%s/a/b/c', 'ba a\nbab', 'bb b\nbbb', 'ysdkywerty', makeCursor(1, 1)); +testSubstituteConfirm('ex_substitute_confirm_some', + '%s/a/b/c', 'ba a\nbab', 'bb a\nbbb', 'yny', makeCursor(1, 1)); +testSubstituteConfirm('ex_substitute_confirm_all', + '%s/a/b/c', 'ba a\nbab', 'bb b\nbbb', 'a', makeCursor(1, 1)); +testSubstituteConfirm('ex_substitute_confirm_accept_then_all', + '%s/a/b/c', 'ba a\nbab', 'bb b\nbbb', 'ya', makeCursor(1, 1)); +testSubstituteConfirm('ex_substitute_confirm_quit', + '%s/a/b/c', 'ba a\nbab', 'bb a\nbab', 'yq', makeCursor(0, 3)); +testSubstituteConfirm('ex_substitute_confirm_last', + '%s/a/b/c', 'ba a\nbab', 'bb b\nbab', 'yl', makeCursor(0, 3)); +testSubstituteConfirm('ex_substitute_confirm_oneline', + '1s/a/b/c', 'ba a\nbab', 'bb b\nbab', 'yl', makeCursor(0, 3)); +testSubstituteConfirm('ex_substitute_confirm_range_accept', + '1,2s/a/b/c', 'aa\na \na\na', 'bb\nb \na\na', 'yyy', makeCursor(1, 0)); +testSubstituteConfirm('ex_substitute_confirm_range_some', + '1,3s/a/b/c', 'aa\na \na\na', 'ba\nb \nb\na', 'ynyy', makeCursor(2, 0)); +testSubstituteConfirm('ex_substitute_confirm_range_all', + '1,3s/a/b/c', 'aa\na \na\na', 'bb\nb \nb\na', 'a', makeCursor(2, 0)); +testSubstituteConfirm('ex_substitute_confirm_range_last', + '1,3s/a/b/c', 'aa\na \na\na', 'bb\nb \na\na', 'yyl', makeCursor(1, 0)); +//:noh should clear highlighting of search-results but allow to resume search through n +testVim('ex_noh_clearSearchHighlight', function(cm, vim, helpers) { + cm.openDialog = helpers.fakeOpenDialog('match'); + helpers.doKeys('?'); + helpers.doEx('noh'); + eq(vim.searchState_.getOverlay(),null,'match-highlighting wasn\'t cleared'); + helpers.doKeys('n'); + helpers.assertCursorAt(0, 11,'can\'t resume search after clearing highlighting'); +}, { value: 'match nope match \n nope Match' }); +// TODO: Reset key maps after each test. +testVim('ex_map_key2key', function(cm, vim, helpers) { + helpers.doEx('map a x'); + helpers.doKeys('a'); + helpers.assertCursorAt(0, 0); + eq('bc', cm.getValue()); +}, { value: 'abc' }); +testVim('ex_map_key2key_to_colon', function(cm, vim, helpers) { + helpers.doEx('map ; :'); + var dialogOpened = false; + cm.openDialog = function() { + dialogOpened = true; + } + helpers.doKeys(';'); + eq(dialogOpened, true); +}); +testVim('ex_map_ex2key:', function(cm, vim, helpers) { + helpers.doEx('map :del x'); + helpers.doEx('del'); + helpers.assertCursorAt(0, 0); + eq('bc', cm.getValue()); +}, { value: 'abc' }); +testVim('ex_map_ex2ex', function(cm, vim, helpers) { + helpers.doEx('map :del :w'); + var tmp = CodeMirror.commands.save; + var written = false; + var actualCm; + CodeMirror.commands.save = function(cm) { + written = true; + actualCm = cm; + }; + helpers.doEx('del'); + CodeMirror.commands.save = tmp; + eq(written, true); + eq(actualCm, cm); +}); +testVim('ex_map_key2ex', function(cm, vim, helpers) { + helpers.doEx('map a :w'); + var tmp = CodeMirror.commands.save; + var written = false; + var actualCm; + CodeMirror.commands.save = function(cm) { + written = true; + actualCm = cm; + }; + helpers.doKeys('a'); + CodeMirror.commands.save = tmp; + eq(written, true); + eq(actualCm, cm); +}); +// Testing registration of functions as ex-commands and mapping to -keys +testVim('ex_api_test', function(cm, vim, helpers) { + var res=false; + var val='from'; + CodeMirror.Vim.defineEx('extest','ext',function(cm,params){ + if(params.args)val=params.args[0]; + else res=true; + }); + helpers.doEx(':ext to'); + eq(val,'to','Defining ex-command failed'); + CodeMirror.Vim.map('',':ext'); + helpers.doKeys('',''); + is(res,'Mapping to key failed'); +}); +// For now, this test needs to be last because it messes up : for future tests. +testVim('ex_map_key2key_from_colon', function(cm, vim, helpers) { + helpers.doEx('map : x'); + helpers.doKeys(':'); + helpers.assertCursorAt(0, 0); + eq('bc', cm.getValue()); +}, { value: 'abc' }); diff --git a/MixERP.Net.FrontEnd/Scripts/CodeMirror/theme/ambiance-mobile.css b/MixERP.Net.FrontEnd/Scripts/CodeMirror/theme/ambiance-mobile.css new file mode 100644 index 000000000..88d332e1a --- /dev/null +++ b/MixERP.Net.FrontEnd/Scripts/CodeMirror/theme/ambiance-mobile.css @@ -0,0 +1,5 @@ +.cm-s-ambiance.CodeMirror { + -webkit-box-shadow: none; + -moz-box-shadow: none; + box-shadow: none; +} diff --git a/MixERP.Net.FrontEnd/Scripts/CodeMirror/theme/ambiance.css b/MixERP.Net.FrontEnd/Scripts/CodeMirror/theme/ambiance.css new file mode 100644 index 000000000..0185426f0 --- /dev/null +++ b/MixERP.Net.FrontEnd/Scripts/CodeMirror/theme/ambiance.css @@ -0,0 +1,75 @@ +/* ambiance theme for codemirror */ + +/* Color scheme */ + +.cm-s-ambiance .cm-keyword { color: #cda869; } +.cm-s-ambiance .cm-atom { color: #CF7EA9; } +.cm-s-ambiance .cm-number { color: #78CF8A; } +.cm-s-ambiance .cm-def { color: #aac6e3; } +.cm-s-ambiance .cm-variable { color: #ffb795; } +.cm-s-ambiance .cm-variable-2 { color: #eed1b3; } +.cm-s-ambiance .cm-variable-3 { color: #faded3; } +.cm-s-ambiance .cm-property { color: #eed1b3; } +.cm-s-ambiance .cm-operator {color: #fa8d6a;} +.cm-s-ambiance .cm-comment { color: #555; font-style:italic; } +.cm-s-ambiance .cm-string { color: #8f9d6a; } +.cm-s-ambiance .cm-string-2 { color: #9d937c; } +.cm-s-ambiance .cm-meta { color: #D2A8A1; } +.cm-s-ambiance .cm-error { color: #AF2018; } +.cm-s-ambiance .cm-qualifier { color: yellow; } +.cm-s-ambiance .cm-builtin { color: #9999cc; } +.cm-s-ambiance .cm-bracket { color: #24C2C7; } +.cm-s-ambiance .cm-tag { color: #fee4ff } +.cm-s-ambiance .cm-attribute { color: #9B859D; } +.cm-s-ambiance .cm-header {color: blue;} +.cm-s-ambiance .cm-quote { color: #24C2C7; } +.cm-s-ambiance .cm-hr { color: pink; } +.cm-s-ambiance .cm-link { color: #F4C20B; } +.cm-s-ambiance .cm-special { color: #FF9D00; } + +.cm-s-ambiance .CodeMirror-matchingbracket { color: #0f0; } +.cm-s-ambiance .CodeMirror-nonmatchingbracket { color: #f22; } + +.cm-s-ambiance .CodeMirror-selected { + background: rgba(255, 255, 255, 0.15); +} +.cm-s-ambiance .CodeMirror-focused .CodeMirror-selected { + background: rgba(255, 255, 255, 0.10); +} + +/* Editor styling */ + +.cm-s-ambiance.CodeMirror { + line-height: 1.40em; + font-family: Monaco, Menlo,"Andale Mono","lucida console","Courier New",monospace !important; + color: #E6E1DC; + background-color: #202020; + -webkit-box-shadow: inset 0 0 10px black; + -moz-box-shadow: inset 0 0 10px black; + box-shadow: inset 0 0 10px black; +} + +.cm-s-ambiance .CodeMirror-gutters { + background: #3D3D3D; + border-right: 1px solid #4D4D4D; + box-shadow: 0 10px 20px black; +} + +.cm-s-ambiance .CodeMirror-linenumber { + text-shadow: 0px 1px 1px #4d4d4d; + color: #222; + padding: 0 5px; +} + +.cm-s-ambiance .CodeMirror-lines .CodeMirror-cursor { + border-left: 1px solid #7991E8; +} + +.cm-s-ambiance .activeline { + background: none repeat scroll 0% 0% rgba(255, 255, 255, 0.031); +} + +.cm-s-ambiance.CodeMirror, +.cm-s-ambiance .CodeMirror-gutters { + background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMgAAADICAQAAAAHUWYVAABFFUlEQVQYGbzBCeDVU/74/6fj9HIcx/FRHx9JCFmzMyGRURhLZIkUsoeRfUjS2FNDtr6WkMhO9sm+S8maJfu+Jcsg+/o/c+Z4z/t97/vezy3z+z8ekGlnYICG/o7gdk+wmSHZ1z4pJItqapjoKXWahm8NmV6eOTbWUOp6/6a/XIg6GQqmenJ2lDHyvCFZ2cBDbmtHA043VFhHwXxClWmeYAdLhV00Bd85go8VmaFCkbVkzlQENzfBDZ5gtN7HwF0KDrTwJ0dypSOzpaKCMwQHKTIreYIxlmhXTzTWkVm+LTynZhiSBT3RZQ7aGfjGEd3qyXQ1FDymqbKxpspERQN2MiRjNZlFFQXfCNFm9nM1zpAsoYjmtRTc5ajwuaXc5xrWskT97RaKzAGe5ARHhVUsDbjKklziiX5WROcJwSNCNI+9w1Jwv4Zb2r7lCMZ4oq5C0EdTx+2GzNuKpJ+iFf38JEWkHJn9DNF7mmBDITrWEg0VWL3pHU20tSZnuqWu+R3BtYa8XxV1HO7GyD32UkOpL/yDloINFTmvtId+nmAjxRw40VMwVKiwrKLE4bK5UOVntYwhOcSSXKrJHKPJedocpGjVz/ZMIbnYUPB10/eKCrs5apqpgVmWzBYWpmtKHecJPjaUuEgRDDaU0oZghCJ6zNMQ5ZhDYx05r5v2muQdM0EILtXUsaKiQX9WMEUotagQzFbUNN6NUPC2nm5pxEWGCjMc3GdJHjSU2kORLK/JGSrkfGEIjncU/CYUnOipoYemwj8tST9NsJmB7TUVXtbUtXATJVZXBMvYeTXJfobgJUPmGMP/yFaWonaa6BcFO3nqcIqCozSZoZoSr1g4zJOzuyGnxTEX3lUEJ7WcZgme8ddaWvWJo2AJR9DZU3CUIbhCSG6ybSwN6qtJVnCU2svDTP2ZInOw2cBTrqtQahtNZn9NcJ4l2NaSmSkkP1noZWnVwkLmdUPOwLZEwy2Z3S3R+4rIG9hcbpPXHFVWcQdZkn2FOta3cKWQnNRC5g1LsJah4GCzSVsKnCOY5OAFRTBekyyryeyilhFKva75r4Mc0aWanGEaThcy31s439KKxTzJYY5WTHPU1FtIHjQU3Oip4xlNzj/lBw23dYZVliQa7WAXf4shetcQfatI+jWRDBPmyNeW6A1P5kdDgyYJlba0BIM8BZu1JfrFwItyjcAMR3K0BWOIrtMEXyhyrlVEx3ui5dUBjmB/Q3CXW85R4mBD0s7B+4q5tKUjOlb9qqmhi5AZ6GFIC5HXtOobdYGlVdMVbNJ8toNTFcHxnoL+muBagcctjWnbNMuR00uI7nQESwg5q2qqrKWIfrNUmeQocY6HuyxJV02wj36w00yhpmUFenv4p6fUkZYqLyuinx2RGOjhCXYyJF84oiU00YMOOhhquNdfbOB7gU88pY4xJO8LVdp6/q2voeB4R04vIdhSE40xZObx1HGGJ/ja0LBthFInKaLPPFzuCaYaoj8JjPME8yoyxo6zlBqkiUZYgq00OYMswbWO5NGmq+xhipxHLRW29ARjNKXO0wRnear8XSg4XFPLKEPUS1GqvyLwiuBUoa7zpZ0l5xxFwWmWZC1H5h5FwU8eQ7K+g8UcVY6TMQreVQT/8uQ8Z+ALIXnSEa2pYZQneE9RZbSBNYXfWYJzW/h/4j4Dp1tYVcFIC5019Vyi4ThPqSFCzjGWaHQTBU8q6vrVwgxP9Lkm840imWKpcLCjYTtrKuwvsKSnrvHCXGkSMk9p6lhckfRpIeis+N2PiszT+mFLspyGleUhDwcLrZqmyeylxwjBcKHEapqkmyangyLZRVOijwOtCY5SsG5zL0OwlCJ4y5KznF3EUNDDrinwiyLZRzOXtlBbK5ITHFGLp8Q0R6ab6mS7enI2cFrxOyHvOCFaT1HThS1krjCwqWeurCkk+willhCC+RSZnRXBiZaC5RXRIZYKp2lyfrHwiKPKR0JDzrdU2EFgpidawlFDR6FgXUMNa+g1FY3bUQh2cLCwosRdnuQTS/S+JVrGLeWIvtQUvONJxlqSQYYKpwoN2kaocLjdVsis4Mk80ESF2YpSkzwldjHkjFCUutI/r+EHDU8oCs6yzL3PhWiEooZdFMkymlas4AcI3KmoMMNSQ3tHzjGWCrcJJdYyZC7QFGwjRL9p+MrRkAGWzIaWCn9W0F3TsK01c2ZvQw0byvxuQU0r1lM0qJO7wW0kRIMdDTtXEdzi4VIh+EoIHm0mWtAtpCixlabgn83fKTI7anJe9ST7WIK1DMGpQmYeA58ImV6ezOGOzK2Kgq01pd60cKWiUi9Lievb/0vIDPHQ05Kzt4ddPckQBQtoaurjyHnek/nKzpQLrVgKPjIkh2v4uyezpv+Xoo7fPFXaGFp1vaLKxQ4uUpQQS5VuQs7BCq4xRJv7fwpVvvFEB3j+620haOuocqMhWd6TTPAEx+mdFNGHdranFe95WrWmIvlY4F1Dle2ECgc6cto7SryuqGGGha0tFQ5V53migUKmg6XKAo4qS3mik+0OZpAhOLeZKicacgaYcyx5hypYQE02ZA4xi/pNhOQxR4klNKyqacj+mpxnLTnnGSo85++3ZCZq6lrZkXlGEX3o+C9FieccJbZWVFjC0Yo1FZnJhoYMFoI1hEZ9r6hwg75HwzBNhbZCdJEfJwTPGzJvaKImw1yYX1HDAmpXR+ZJQ/SmgqMNVQb5vgamGwLtt7VwvP7Qk1xpiM5x5Cyv93E06MZmgs0Nya2azIKOYKCGBQQW97RmhKNKF02JZqHEJ4o58qp7X5EcZmc56trXEqzjCBZ1MFGR87Ql2tSTs6CGxS05PTzRQorkbw7aKoKXFDXsYW42VJih/q+FP2BdTzDTwVqOYB13liM50vG7wy28qagyuIXMeQI/Oqq8bcn5wJI50xH00CRntyfpL1T4hydYpoXgNiFzoIUTDZnLNRzh4TBHwbYGDvZkxmlyJloyr6tRihpeUG94GnKtIznREF0tzJG/OOr73JBcrSh1k6WuTprgLU+mnSGnv6Zge0NNz+kTDdH8nuAuTdJDCNb21LCiIuqlYbqGzT3RAoZofQfjFazkqeNWdYaGvYTM001EW2oKPvVk1ldUGSgUtHFwjKM1h9jnFcmy5lChoLNaQMGGDsYbKixlaMBmmsx1QjCfflwTfO/gckW0ruZ3jugKR3R5W9hGUWqCgxuFgsuaCHorotGKzGaeZB9DMsaTnKCpMtwTvOzhYk0rdrArKCqcaWmVk1+F372ur1YkKxgatI8Qfe1gIX9wE9FgS8ESmuABIXnRUbCapcKe+nO7slClSZFzpV/LkLncEb1qiO42fS3R855Su2mCLh62t1SYZZYVmKwIHjREF2uihTzB20JOkz7dkxzYQnK0UOU494wh+VWRc6Un2kpTaVgLDFEkJ/uhzRcI0YKGgpGWOlocBU/a4fKoJ/pEaNV6jip3+Es9VXY078rGnmAdf7t9ylPXS34RBSuYPs1UecZTU78WanhBCHpZ5sAoTz0LGZKjPf9TRypqWEiTvOFglL1fCEY3wY/++rbk7C8bWebA6p6om6PgOL2kp44TFJlVNBXae2rqqdZztOJpT87GQsE9jqCPIe9VReZuQ/CIgacsyZdCpIScSYqcZk8r+nsyCzhyfhOqHGOIvrLknC8wTpFcaYiGC/RU1NRbUeUpocQOnkRpGOrIOcNRx+1uA0UrzhSSt+VyS3SJpnFWkzNDqOFGIWcfR86DnmARTQ1HKIL33ExPiemeOhYSSjzlSUZZuE4TveoJLnBUOFof6KiysCbnAEcZgcUNTDOwkqWu3RWtmGpZwlHhJENdZ3miGz0lJlsKnjbwqSHQjpxnFDlTLLwqJPMZMjd7KrzkSG7VsxXBZE+F8YZkb01Oe00yyRK9psh5SYh29ySPKBo2ylNht7ZkZnsKenjKNJu9PNEyZpaCHv4Kt6RQsLvAVp7M9kIimmCUwGeWqLMmGuIotYMmWNpSahkhZw9FqZsVnKJhsjAHvtHMsTM9fCI06Dx/u3vfUXCqfsKRc4oFY2jMsoo/7DJDwZ1CsIKnJu+J9ldkpmiCxQx1rWjI+T9FwcWWzOuaYH0Hj7klNRVWEQpmaqosakiGNTFHdjS/qnUdmf0NJW5xsL0HhimCCZZSRzmSPTXJQ4aaztAwtZnoabebJ+htCaZ7Cm535ByoqXKbX1WRc4Eh2MkRXWzImVc96Cj4VdOKVxR84VdQsIUM8Psoou2byVHyZFuq7O8otbSQ2UAoeEWTudATLGSpZzVLlXVkPU2Jc+27lsw2jmg5T5VhbeE3BT083K9WsTTkFU/Osi0rC5lRlpwRHUiesNS0sOvmqGML1aRbPAxTJD9ZKtxuob+hhl8cwYGWpJ8nub7t5p6coYbMovZ1BTdaKn1jYD6h4GFDNFyT/Kqe1XCXphXHOKLZmuRSRdBPEfVUXQzJm5YGPGGJdvAEr7hHNdGZnuBvrpciGmopOLf5N0uVMy0FfYToJk90uUCbJupaVpO53UJXR2bVpoU00V2KOo4zMFrBd0Jtz2pa0clT5Q5L8IpQ177mWQejPMEJhuQjS10ref6HHjdEhy1P1EYR7GtO0uSsKJQYLiTnG1rVScj5lyazpqWGl5uBbRWl7m6ixGOOnEsMJR7z8J0n6KMnCdxhiNYQCoZ6CmYLnO8omC3MkW3bktlPmEt/VQQHejL3+dOE5FlPdK/Mq8hZxxJtLyRrepLThYKbLZxkSb5W52vYxNOaOxUF0yxMUPwBTYqCzy01XayYK0sJyWBLqX0MwU5CzoymRzV0EjjeUeLgDpTo6ij42ZAzvD01dHUUTPLU96MdLbBME8nFBn7zJCMtJcZokn8YoqU0FS5WFKyniHobguMcmW8N0XkWZjkyN3hqOMtS08r+/xTBwpZSZ3qiVRX8SzMHHjfUNFjgHEPmY9PL3ykEzxkSre/1ZD6z/NuznuB0RcE1TWTm9zRgfUWVJiG6yrzgmWPXC8EAR4Wxhlad0ZbgQyEz3pG5RVEwwDJH2mgKpjcTiCOzn1lfUWANFbZ2BA8balnEweJC9J0iuaeZoI+ippFCztEKVvckR2iice1JvhVytrQwUAZpgsubCPaU7xUe9vWnaOpaSBEspalykhC9bUlOMpT42ZHca6hyrqKmw/wMR8H5ZmdFoBVJb03O4UL0tSNnvIeRmkrLWqrs78gcrEn2tpcboh0UPOW3UUR9PMk4T4nnNKWmCjlrefhCwxRNztfmIQVdDElvS4m1/WuOujoZCs5XVOjtKPGokJzsYCtFYoWonSPT21DheU/wWhM19FcElwqNGOsp9Q8N/cwXaiND1MmeL1Q5XROtYYgGeFq1aTMsoMmcrKjQrOFQTQ1fmBYhmW6o8Jkjc7iDJRTBIo5kgJD5yMEYA3srCg7VFKwiVJkmRCc5ohGOKhsYMn/XBLdo5taZjlb9YAlGWRimqbCsoY7HFAXLa5I1HPRxMMsQDHFkWtRNniqT9UEeNjcE7RUlrCJ4R2CSJuqlKHWvJXjAUNcITYkenuBRB84TbeepcqTj3zZyFJzgYQdHnqfgI0ddUwS6GqWpsKWhjq9cV0vBAEMN2znq+EBfIWT+pClYw5xsTlJU6GeIBsjGmmANTzJZiIYpgrM0Oa8ZMjd7NP87jxhqGOhJlnQtjuQpB+8aEE00wZFznSJPyHxgH3HkPOsJFvYk8zqCHzTs1BYOa4J3PFU+UVRZxlHDM4YavlNUuMoRveiZA2d7grMNc2g+RbSCEKzmgYsUmWmazFJyoiOZ4KnyhKOGRzWJa0+moyV4TVHDzn51Awtqaphfk/lRQ08FX1iiqxTB/kLwd0VynKfEvI6cd4XMV5bMhZ7gZUWVzYQ6Nm2BYzxJbw3bGthEUUMfgbGeorae6DxHtJoZ6alhZ0+ytiVoK1R4z5PTrOECT/SugseEOlb1MMNR4VRNcJy+V1Hg9ONClSZFZjdHlc6W6FBLdJja2MC5hhpu0DBYEY1TFGwiFAxRRCsYkiM9JRb0JNMVkW6CZYT/2EiTGWmo8k+h4FhDNE7BvppoTSFnmCV5xZKzvcCdDo7VVPnIU+I+Rc68juApC90MwcFCsJ5hDqxgScYKreruyQwTqrzoqDCmhWi4IbhB0Yrt3RGa6GfDv52rKXWhh28dyZaWUvcZeMTBaZoSGyiCtRU5J8iviioHaErs7Jkj61syVzTTgOcUOQ8buFBTYWdL5g3T4qlpe0+wvD63heAXRfCCIed9RbCsp2CiI7raUOYOTU13N8PNHvpaGvayo4a3LLT1lDrVEPT2zLUlheB1R+ZTRfKWJ+dcocLJfi11vyJ51lLqJ0WD7tRwryezjiV5W28uJO9qykzX8JDe2lHl/9oyBwa2UMfOngpXCixvKdXTk3wrsKmiVYdZIqsoWEERjbcUNDuiaQomGoIbFdEHmsyWnuR+IeriKDVLnlawlyNHKwKlSU631PKep8J4Q+ayjkSLKYLhalNHlYvttb6fHm0p6OApsZ4l2VfdqZkjuysy6ysKLlckf1KUutCTs39bmCgEyyoasIWlVaMF7mgmWtBT8Kol5xpH9IGllo8cJdopcvZ2sImlDmMIbtDk3KIpeNiS08lQw11NFPTwVFlPP6pJ2gvRfI7gQUfmNAtf6Gs0wQxDsKGlVBdF8rCa3jzdwMaGHOsItrZk7hAyOzpK9VS06j5F49b0VNGOOfKs3lDToMsMBe9ZWtHFEgxTJLs7qrygKZjUnmCYoeAqeU6jqWuLJup4WghOdvCYJnrSkSzoyRkm5M2StQwVltPkfCAk58tET/CSg+8MUecmotMEnhBKfWBIZsg2ihruMJQaoIm+tkTLKEqspMh00w95gvFCQRtDwTT1gVDDSEVdlwqZfxoQRbK0g+tbiBZxzKlpnpypejdDwTaeOvorMk/IJE10h9CqRe28hhLbe0pMsdSwv4ZbhKivo2BjDWfL8UKJgeavwlwb5KlwhyE4u4XkGE2ytZCznKLCDZZq42VzT8HLCrpruFbIfOIINmh/qCdZ1ZBc65kLHR1Bkyf5zn6pN3SvGKIlFNGplhrO9QSXanLOMQTLCa0YJCRrCZm/CZmrLTm7WzCK4GJDiWUdFeYx1LCFg3NMd0XmCuF3Y5rITLDUsYS9zoHVzwnJoYpSTQoObyEzr4cFBNqYTopoaU/wkyLZ2lPhX/5Y95ulxGTV7KjhWrOZgl8MyUUafjYraNjNU1N3IWcjT5WzWqjwtoarHSUObGYO3GCJZpsBlnJGPd6ZYLyl1GdCA2625IwwJDP8GUKymbzuyPlZlvTUsaUh5zFDhRWFzPKKZLAlWdcQbObgF9tOqOsmB1dqcqYJmWstFbZRRI9poolmqiLnU0POvxScpah2iSL5UJNzgScY5+AuIbpO0YD3NCW+dLMszFSdFCWGqG6eVq2uYVNDdICGD6W7EPRWZEY5gpsE9rUkS3mijzzJnm6UpUFXG1hCUeVoS5WfNcFpblELL2qqrCvMvRfd45oalvKU2tiQ6ePJOVMRXase9iTtLJztPxJKLWpo2CRDcJwn2sWSLKIO1WQWNTCvpVUvOZhgSC40JD0dOctaSqzkCRbXsKlb11Oip6PCJ0IwSJM31j3akRxlP7Rwn6aGaUL0qiLnJkvB3xWZ2+Q1TfCwpQH3G0o92UzmX4o/oJNQMMSQc547wVHhdk+VCw01DFYEnTxzZKAm74QmeNNR1w6WzEhNK15VJzuCdxQ53dRUDws5KvwgBMOEgpcVNe0hZI6RXT1Jd0cyj5nsaEAHgVmGaJIlWdsc5Ui2ElrRR6jrRAttNMEAIWrTDFubkZaok7/AkzfIwfuWVq0jHzuCK4QabtLUMVPB3kJ0oyHTSVFlqMALilJf2Rf8k5aaHtMfayocLBS8L89oKoxpJvnAkDPa0qp5DAUTHKWmCcnthlou8iCKaFFLHWcINd1nyIwXqrSxMNmSs6KmoL2QrKuWtlQ5V0120xQ5vRyZS1rgFkWwhiOwiuQbR0OOVhQM9iS3tiXp4RawRPMp5tDletOOBL95MpM01dZTBM9pkn5qF010rIeHFcFZhmSGpYpTsI6nwhqe5C9ynhlpp5ophuRb6WcJFldkVnVEwwxVfrVkvnWUuNLCg5bgboFHPDlDPDmnK7hUrWiIbjadDclujlZcaokOFup4Ri1kacV6jmrrK1hN9bGwpKEBQ4Q6DvIUXOmo6U5LqQM6EPyiKNjVkPnJkDPNEaxhiFay5ExW1NXVUGqcpYYdPcGiCq7z/TSlbhL4pplWXKd7NZO5QQFrefhRQW/NHOsqcIglc4UhWklR8K0QzbAw08CBDnpbgqXdeD/QUsM4RZXDFBW6WJKe/mFPdH0LtBgiq57wFLzlyQzz82qYx5D5WJP5yVJDW01BfyHnS6HKO/reZqId1WGa4Hkh2kWodJ8i6KoIPlAj2hPt76CzXsVR6koPRzWTfKqIentatYpQw2me4AA3y1Kind3SwoOKZDcFXTwl9tWU6mfgRk9d71sKtlNwrjnYw5tC5n5LdKiGry3JKNlHEd3oaMCFHrazBPMp/uNJ+V7IudcSbeOIdjUEdwl0VHCOZo5t6YluEuaC9mQeMgSfOyKnYGFHcIeQ84yQWbuJYJpZw5CzglDH7gKnWqqM9ZTaXcN0TeYhR84eQtJT76JJ1lREe7WnnvsMmRc9FQ7SBBM9mV3lCUdmHk/S2RAMt0QjFNFqQpWjDPQ01DXWUdDBkXziKPjGEP3VP+zIWU2t7im41FOloyWzn/L6dkUy3VLDaZ6appgDLHPjJEsyvJngWEPUyVBiAaHCTEXwrLvSEbV1e1gKJniicWorC1MUrVjB3uDhJE/wgSOzk1DXpk0k73qCM8xw2UvD5kJmDUfOomqMpWCkJRlvKXGmoeBm18USjVIk04SClxTB6YrgLAPLWYK9HLUt5cmc0vYES8GnTeRc6skZbQkWdxRsIcyBRzx1DbTk9FbU0caTPOgJHhJKnOGIVhQqvKmo0llRw9sabrZkDtdg3PqaKi9oatjY8B+G371paMg6+mZFNNtQ04mWBq3rYLOmtWWQp8KJnpy9DdFensyjdqZ+yY40VJlH8wcdLzC8PZnvHMFUTZUrDTkLyQaGus5X5LzpYAf3i+e/ZlhqGqWhh6Ou6xTR9Z6oi5AZZtp7Mj2EEm8oSpxiYZCHU/1fbGdNNNRRoZMhmilEb2gqHOEJDtXkHK/JnG6IrvbPCwV3NhONVdS1thBMs1T4QOBcTWa2IzhMk2nW5Kyn9tXUtpv9RsG2msxk+ZsQzRQacJncpgke0+T8y5Fzj8BiGo7XlJjaTIlpQs7KFjpqGnKuoyEPeIKnFMkZHvopgh81ySxNFWvJWcKRs70j2FOT012IllEEO1n4pD1513Yg2ssQPOThOkvyrqHUdEXOSEsihmBbTbKX1kLBPWqWkLOqJbjB3GBIZmoa8qWl4CG/iZ7oiA72ZL7TJNeZUY7kFQftDcHHluBzRbCegzMtrRjVQpX2lgoPKKLJAkcbMl01XK2p7yhL8pCBbQ3BN2avJgKvttcrWDK3CiUOVxQ8ZP+pqXKyIxnmBymCg5vJjNfkPK4+c8cIfK8ocVt7kmfd/I5SR1hKvCzUtb+lhgc00ZaO6CyhIQP1Uv4yIZjload72PXX0OIJvnFU+0Zf6MhsJwTfW0r0UwQfW4LNLZl5HK261JCZ4qnBaAreVAS3WrjV0LBnNDUNNDToCEeFfwgcb4gOEqLRhirWkexrCEYKVV711DLYEE1XBEsp5tpTGjorkomKYF9FDXv7fR3BGwbettSxnyL53MBPjsxDZjMh+VUW9NRxq1DhVk+FSxQcaGjV9Pawv6eGByw5qzoy7xk4RsOShqjJwWKe/1pEEfzkobeD/dQJmpqedcyBTy2sr4nGNRH0c0SPWTLrqAc0OQcb/gemKgqucQT7ySWKCn2EUotoCvpZct7RO2sy/QW0IWcXd7pQRQyZVwT2USRO87uhjioTLKV2brpMUcMQRbKH/N2T+UlTpaMls6cmc6CCNy3JdYYSUzzJQ4oSD3oKLncULOiJvjBEC2oqnCJkJluCYy2ZQ5so9YYlZ1VLlQU1mXEW1jZERwj/MUSRc24TdexlqLKfQBtDTScJUV8FszXBEY5ktpD5Ur9hYB4Nb1iikw3JoYpkKX+RodRKFt53MMuRnKSpY31PwYaGaILh3wxJGz9TkTPEETxoCWZrgvOlmyMzxFEwVJE5xZKzvyJ4WxEc16Gd4Xe3Weq4XH2jKRikqOkGQ87hQnC7wBmGYLAnesX3M+S87eFATauuN+Qcrh7xIxXJbUIdMw3JGE3ylCWzrieaqCn4zhGM19TQ3z1oH1AX+pWEqIc7wNGAkULBo/ZxRaV9NNyh4Br3rCHZzbzmSfawBL0dNRwpW1kK9mxPXR9povcdrGSZK9c2k0xwFGzjuniCtRSZCZ6ccZ7gaktmgAOtKbG/JnOkJrjcQTdFMsxRQ2cLY3WTIrlCw1eWKn8R6pvt4GFDso3QoL4a3nLk3G6JrtME3dSenpx7PNFTmga0EaJTLQ061sEeQoWXhSo9LTXsaSjoJQRXeZLtDclbCrYzfzHHeaKjHCVOUkQHO3JeEepr56mhiyaYYKjjNU+Fed1wS5VlhWSqI/hYUdDOkaxiKehoyOnrCV5yBHtbWFqTHCCwtpDcYolesVR5yUzTZBb3RNMd0d6WP+SvhuBmRcGxnuQzT95IC285cr41cLGQ6aJJhmi4TMGempxeimBRQw1tFKV+8jd6KuzoSTqqDxzRtpZkurvKEHxlqXKRIjjfUNNXQsNOsRScoWFLT+YeRZVD3GRN0MdQcKqQjHDMrdGGVu3iYJpQx3WGUvfbmxwFfR20WBq0oYY7LMFhhgYtr8jpaEnaOzjawWWaTP8mMr0t/EPDPoqcnxTBI5o58L7uoWnMrpoqPwgVrlAUWE+V+TQl9rawoyP6QGAlQw2TPRX+YSkxyBC8Z6jhHkXBgQL7WII3DVFnRfCrBfxewv9D6xsyjys4VkhWb9pUU627JllV0YDNHMku/ldNMMXDEo4aFnAkk4U6frNEU4XgZUPmEKHUl44KrzmYamjAbh0JFvGnaTLPu1s9jPCwjFpYiN7z1DTOk/nc07CfDFzmCf7i+bfNHXhDtLeBXzTBT5rkMvWOIxpl4EMh2LGJBu2syDnAEx2naEhHDWMMzPZEhygyS1mS5RTJr5ZkoKbEUoYqr2kqdDUE8ztK7OaIntJkFrIECwv8LJTaVx5XJE86go8dFeZ3FN3rjabCAYpoYEeC9zzJVULBbmZhDyd7ko09ydpNZ3nm2Kee4FPPXHnYEF1nqOFEC08LUVcDvYXkJHW8gTaKCk9YGOeIJhqiE4ToPEepdp7IWFjdwnWaufGMwJJCMtUTTBBK9BGCOy2tGGrJTHIwyEOzp6aPzNMOtlZkDvcEWpP5SVNhfkvDxhmSazTJXYrM9U1E0xwFVwqZQwzJxw6+kGGGUj2FglGGmnb1/G51udRSMNlTw6GGnCcUwVcOpmsqTHa06o72sw1RL02p9z0VbnMLOaIX3QKaYKSCFQzBKEUNHTSc48k53RH9wxGMtpQa5KjjW0W0n6XCCCG4yxNNdhQ4R4l1Ff+2sSd6UFHiIEOyqqFgT01mEUMD+joy75jPhOA+oVVLm309FR4yVOlp4RhLiScNmSmaYF5Pw0STrOIoWMSR2UkRXOMp+M4SHW8o8Zoi6OZgjKOaFar8zZDzkWzvKOjkKBjmCXby8JahhjXULY4KlzgKLvAwxVGhvyd4zxB1d9T0piazmKLCVZY5sKiD0y2ZSYrkUEPUbIk+dlQ4SJHTR50k1DPaUWIdTZW9NJwnJMOECgd7ou/MnppMJ02O1VT4Wsh85MnZzcFTngpXGKo84qmwgKbCL/orR/SzJ2crA+t6Mp94KvxJUeIbT3CQu1uIdlQEOzlKfS3UMcrTiFmOuroocrZrT2AcmamOKg8YomeEKm/rlT2sociMaybaUlFhuqHCM2qIJ+rg4EcDFymiDSxzaHdPcpE62pD5kyM5SBMoA1PaUtfIthS85ig1VPiPPYXgYEMNk4Qq7TXBgo7oT57gPUdwgCHzhIVFPFU6OYJzHAX9m5oNrVjeE61miDrqQ4VSa1oiURTsKHC0IfjNwU2WzK6eqK8jWln4g15TVBnqmDteCJ501PGAocJhhqjZdtBEB6lnhLreFJKxmlKbeGrqLiSThVIbCdGzloasa6lpMQXHCME2boLpJgT7yWaemu6wBONbqGNVRS0PKIL7LckbjmQtR7K8I5qtqel+T/ChJTNIKLjdUMNIRyvOEko9YYl2cwQveBikCNawJKcLBbc7+JM92mysNvd/Fqp8a0k6CNEe7cnZrxlW0wQXaXjaktnRwNOGZKYiONwS7a1JVheq3WgJHlQUGKHKmp4KAxXR/ULURcNgoa4zhKSLpZR3kxRRb0NmD0OFn+UCS7CzI1nbP6+o4x47QZE5xRCt3ZagnYcvmpYQktXdk5YKXTzBC57kKEe0VVuiSYqapssMS3C9p2CKkHOg8B8Pa8p5atrIw3qezIWanMGa5HRDNF6RM9wcacl0N+Q8Z8hsIkSnaIIdHRUOEebAPy1zbCkhM062FCJtif7PU+UtoVXzWKqM1PxXO8cfdruhFQ/a6x3JKYagvVDhQEtNiyiiSQ7OsuRsZUku0CRNDs4Sog6KKjsZgk2bYJqijgsEenoKeniinRXBn/U3lgpPdyDZynQx8IiioMnCep5Ky8mjGs6Wty0l1hUQTcNWswS3WRp2kCNZwJG8omG8JphPUaFbC8lEfabwP7VtM9yoaNCAjpR41VNhrD9LkbN722v0CoZMByFzhaW+MyzRYEWFDQwN2M4/JiT76PuljT3VU/A36eaIThb+R9oZGOAJ9tewkgGvqOMNRWYjT/Cwu99Q8LqDE4TgbLWxJ1jaDDAERsFOFrobgjUsBScaguXU8kKm2RL19tRypSHnHNlHiIZqgufs4opgQdVdwxBNNFBR6kVFqb8ogimOzB6a6HTzrlDHEpYaxjiiA4TMQobkDg2vejjfwJGWmnbVFAw3H3hq2NyQfG7hz4aC+w3BbwbesG0swYayvpAs6++Ri1Vfzx93mFChvyN5xVHTS+0p9aqCAxyZ6ZacZyw5+7uuQkFPR9DDk9NOiE7X1PCYJVjVUqq7JlrHwWALF5nfHNGjApdpqgzx5OwilDhCiDYTgnc9waGW4BdLNNUQvOtpzDOWHDH8D7TR/A/85KljEQu3NREc4Pl/6B1Hhc8Umb5CsKMmGC9EPcxoT2amwHNCmeOEnOPbklnMkbOgIvO5UMOpQrS9UGVdt6iH/fURjhI/WOpaW9OKLYRod6HCUEdOX000wpDZQ6hwg6LgZfOqo1RfT/CrJzjekXOGhpc1VW71ZLbXyyp+93ILbC1kPtIEYx0FIx1VDrLoVzXRKRYWk809yYlC9ImcrinxtabKnzRJk3lAU1OLEN1j2zrYzr2myHRXJFf4h4QKT1qSTzTB5+ZNTzTRkAxX8FcLV2uS8eoQQ2aAkFzvCM72sJIcJET3WPjRk5wi32uSS9rfZajpWEvj9hW42F4o5NytSXYy8IKHay10VYdrcl4SkqscrXpMwyGOgtkajheSxdQqmpxP1L3t4R5PqasFnrQEjytq6qgp9Y09Qx9o4S1FzhUCn1kyHSzBWLemoSGvOqLNhZyBjmCaAUYpMgt4Ck7wBBMMwWKWgjsUwTaGVsxWC1mYoKiyqqeGKYqonSIRQ3KIkHO0pmAxTdBHkbOvfllfr+AA+7gnc50huVKYK393FOyg7rbPO/izI7hE4CnHHHnJ0ogNPRUGeUpsrZZTBJcrovUcJe51BPsr6GkJdhCCsZ6aTtMEb2pqWkqeVtDXE/QVggsU/Nl86d9RMF3DxvZTA58agu810RWawCiSzzXBeU3MMW9oyJUedvNEvQyNu1f10BSMddR1vaLCYpYa/mGocLSiYDcLbQz8aMn5iyF4xBNMs1P0QEOV7o5gaWGuzSeLue4tt3ro7y4Tgm4G/mopdZgl6q0o6KzJWE3mMksNr3r+a6CbT8g5wZNzT9O7fi/zpaOmnz3BRoqos+tv9zMbdpxsqDBOEewtJLt7cg5wtKKbvldpSzRRCD43VFheCI7yZLppggMVBS/KMAdHODJvOwq2NQSbKKKPLdFWQs7Fqo+mpl01JXYRgq8dnGLhTiFzqmWsUMdpllZdbKlyvSdYxhI9YghOtxR8LgSLWHK62mGGVoxzBE8LNWzqH9CUesQzFy5RQzTc56mhi6fgXEWwpKfE5Z7M05ZgZUPmo6auiv8YKzDYwWBLMErIbKHJvOwIrvEdhOBcQ9JdU1NHQ7CXn2XIDFBKU2WAgcX9UAUzDXWd5alwuyJ41Z9rjKLCL4aCp4WarhPm2rH+SaHUYE001JDZ2ZAzXPjdMpZWvC9wmqIB2lLhQ01D5jO06hghWMndbM7yRJMsoCj1vYbnFQVrW9jak3OlEJ3s/96+p33dEPRV5GxiqaGjIthUU6FFEZyqCa5qJrpBdzSw95IUnOPIrCUUjRZQFrbw5PR0R1qiYx3cb6nrWUMrBmmiBQxVHtTew5ICP/ip6g4hed/Akob/32wvBHsIOX83cI8hGeNeNPCIkPmXe8fPKx84OMSRM1MTdXSwjCZ4S30jVGhvqTRak/OVhgGazHuOCud5onEO1lJr6ecVyaOK6H7zqlBlIaHE0oroCgfvGJIdPcmfLNGLjpz7hZwZQpUbFME0A1cIJa7VNORkgfsMBatbKgwwJM9bSvQXeNOvbIjelg6WWvo5kvbKaJJNHexkKNHL9xRyFlH8Ti2riB5wVPhUk7nGkJnoCe428LR/wRGdYIlmWebCyxou1rCk4g/ShugBDX0V0ZQWkh0dOVsagkM0yV6OoLd5ye+pRlsCr0n+KiQrGuq5yJDzrTAXHtLUMduTDBVKrSm3eHL+6ijxhFDX9Z5gVU/wliHYTMiMFpKLNMEywu80wd3meoFmt6VbRMPenhrOc6DVe4pgXU8DnnHakLOIIrlF4FZPIw6R+zxBP0dyq6OOZ4Q5sLKCcz084ok+VsMMyQhNZmmBgX5xIXOEJTmi7VsGTvMTNdHHhpzdbE8Du2oKxgvBqQKdDDnTFOylCFaxR1syz2iqrOI/FEpNc3C6f11/7+ASS6l2inq2ciTrCCzgyemrCL5SVPjQkdPZUmGy2c9Sw9FtR1sS30RmsKPCS4rkIC/2U0MduwucYolGaPjKEyhzmiPYXagyWbYz8LWBDdzRimAXzxx4z8K9hpzlhLq+NiQ97HuKorMUfK/OVvC2JfiHUPCQI/q7J2gjK+tTDNxkCc4TMssqCs4TGtLVwQihyoAWgj9bosU80XGW6Ac9TJGziaUh5+hnFcHOnlaM1iRn29NaqGENTTTSUHCH2tWTeV0osUhH6psuVLjRUmGWhm6OZEshGeNowABHcJ2Bpy2ZszRcKkRXd2QuKVEeXnbfaEq825FguqfgfE2whlChSRMdron+LATTPQ2Z369t4B9C5gs/ylzv+CMmepIDPclFQl13W0rspPd1JOcbghGOEutqCv5qacURQl3dDKyvyJlqKXGPgcM9FfawJAMVmdcspcYKOZc4GjDYkFlK05olNMHyHn4zFNykyOxt99RkHlfwmiHo60l2EKI+mhreEKp080Tbug08BVPcgoqC5zWt+NLDTZ7oNSF51N1qie7Va3uCCwyZbkINf/NED6jzOsBdZjFN8oqG3wxVunqCSYYKf3EdhJyf9YWGf7tRU2oH3VHgPr1fe5J9hOgHd7xQ0y7qBwXr23aGErP0cm64JVjZwsOGqL+mhNgZmhJLW2oY4UhedsyBgzrCKrq7BmcpNVhR6jBPq64Vgi+kn6XE68pp8J5/+0wRHGOpsKenQn9DZntPzjRLZpDAdD2fnSgkG9tmIXnUwQ6WVighs7Yi2MxQ0N3CqYaCXkJ0oyOztMDJjmSSpcpvlrk0RMMOjmArQ04PRV1DO1FwhCVaUVPpKUM03JK5SxPsIWRu8/CGHi8UHChiqGFDTbSRJWeYUDDcH6vJWUxR4k1FXbMUwV6e4AJFXS8oMqsZKqzvYQ9DDQdZckY4aGsIhtlubbd2r3j4QBMoTamdPZk7O/Bf62lacZwneNjQoGcdVU7zJOd7ghsUHOkosagic6cnWc8+4gg285R6zZP5s1/LUbCKIznTwK36PkdwlOrl4U1LwfdCCa+IrvFkmgw1PCAUXKWo0sURXWcI2muKJlgyFzhynCY4RBOsqCjoI1R5zREco0n2Vt09BQtYSizgKNHfUmUrQ5UOCh51BFcLmY7umhYqXKQomOop8bUnWNNQcIiBcYaC6xzMNOS8JQQfeqKBmmglB+97ok/lfk3ygaHSyZaCRTzRxQo6GzLfa2jWBPepw+UmT7SQEJyiyRkhBLMVOfcoMjcK0eZChfUNzFAUzCsEN5vP/X1uP/n/aoMX+K+nw/Hjr/9xOo7j7Pju61tLcgvJpTWXNbfN5jLpi6VfCOviTktKlFusQixdEKWmEBUKNaIpjZRSSOXSgzaaKLdabrm1/9nZ+/f+vd/vz/v9+Xy+zZ7PRorYoZqyLrCwQdEAixxVOEXNNnjX2nUSRlkqGmWowk8lxR50JPy9Bo6qJXaXwNvREBvnThPEPrewryLhcAnj5WE15Fqi8W7R1sAuEu86S4ENikItFN4xkv9Af4nXSnUVcLiA9xzesFpivRRVeFKtsMRaKBhuSbjOELnAUtlSQUpXgdfB4Z1oSbnFEetbQ0IrAe+Y+pqnDcEJFj6S8LDZzZHwY4e3XONNlARraomNEt2bkvGsosA3ioyHm+6jCMbI59wqt4eeara28IzEmyPgoRaUOEDhTVdEJhmCoTWfC0p8aNkCp0oYqih2iqGi4yXeMkOsn4LdLLnmKfh/YogjNsPebeFGR4m9BJHLzB61XQ3BtpISfS2FugsK9FAtLWX1dCRcrCnUp44CNzuCowUZmxSRgYaE6Za0W2u/E7CVXCiI/UOR8aAm1+OSyE3mOUcwyc1zBBeoX1kiKy0Zfxck1Gsyulti11i83QTBF5Kg3pDQThFMVHiPSlK+0cSedng/VaS8bOZbtsBcTcZAR8JP5KeqQ1OYKAi20njdNNRpgnsU//K+JnaXJaGTomr7aYIphoRn9aeShJWKEq9LcozSF7QleEfDI5LYm5bgVkFkRwVDBCVu0DDIkGupo8TZBq+/pMQURYErJQmPKGKjNDkWOLx7Jd5QizdUweIaKrlP7SwJDhZvONjLkOsBBX9UpGxnydhXkfBLQ8IxgojQbLFnJf81JytSljclYYyEFyx0kVBvKWOFJmONpshGAcsduQY5giVNCV51eOdJYo/pLhbvM0uDHSevNKRcrKZIqnCtJeEsO95RoqcgGK4ocZcho1tTYtcZvH41pNQ7vA0WrhIfOSraIIntIAi+NXWCErdbkvrWwjRLrt0NKUdL6KSOscTOdMSOUtBHwL6OLA0vNSdynaWQEnCpIvKaIrJJEbvHkmuNhn6OjM8VkSGSqn1uYJCGHnq9I3aLhNME3t6GjIkO7xrNFumpyTNX/NrwX7CrIRiqqWijI9JO4d1iieykyfiposQIQ8YjjsjlBh6oHWbwRjgYJQn2NgSnNycmJAk3NiXhx44Sxykihxm8ybUwT1OVKySc7vi3OXVkdBJ4AyXBeksDXG0IhgtYY0lY5ahCD0ehborIk5aUWRJviMA7Xt5kyRjonrXENkm8yYqgs8VzgrJmClK20uMM3jRJ0FiQICQF9hdETlLQWRIb5ki6WDfWRPobvO6a4GP5mcOrNzDFELtTkONLh9dXE8xypEg7z8A9jkhrQ6Fhjlg/QVktJXxt4WXzT/03Q8IaQWSqIuEvloQ2mqC9Jfi7wRul4RX3pSPlzpoVlmCtI2jvKHCFhjcM3sN6lqF6HxnKelLjXWbwrpR4xzuCrTUZx2qq9oAh8p6ixCUGr78g8oyjRAtB5CZFwi80VerVpI0h+IeBxa6Zg6kWvpDHaioYYuEsRbDC3eOmC2JvGYLeioxGknL2UATNJN6hmtj1DlpLvDVmocYbrGCVJKOrg4X6DgddLA203BKMFngdJJFtFd7vJLm6KEpc5yjQrkk7M80SGe34X24nSex1Ra5Omgb71JKyg8SrU3i/kARKwWpH0kOGhKkObyfd0ZGjvyXlAkVZ4xRbYJ2irFMkFY1SwyWxr2oo4zlNiV+7zmaweFpT4kR3kaDAFW6xpSqzJay05FtYR4HmZhc9UxKbbfF2V8RG1MBmSaE+kmC6JnaRXK9gsiXhJHl/U0qM0WTcbyhwkYIvFGwjSbjfwhiJt8ZSQU+Bd5+marPMOkVkD0muxYLIfEuhh60x/J92itguihJSEMySVPQnTewnEm+620rTQEMsOfo4/kP/0ARvWjitlpSX7GxBgcMEsd3EEeYWvdytd+Saawi6aCIj1CkGb6Aj9rwhx16Cf3vAwFy5pyLhVonXzy51FDpdEblbkdJbUcEPDEFzQ8qNmhzzLTmmKWKbFCXeEuRabp6rxbvAtLF442QjQ+wEA9eL1xSR7Q0JXzlSHjJ4exq89yR0laScJ/FW6z4a73pFMEfDiRZvuvijIt86RaSFOl01riV2mD1UEvxGk/Geg5aWwGki1zgKPG9J2U8PEg8qYvMsZeytiTRXBMslCU8JSlxi8EabjwUldlDNLfzTUmCgxWsjqWCOHavYAqsknKFIO0yQ61VL5AVFxk6WhEaCAkdJgt9aSkzXlKNX2jEa79waYuc7gq0N3GDJGCBhoiTXUEPsdknCUE1CK0fwsiaylSF2uiDyO4XX3pFhNd7R4itFGc0k/ElBZwWvq+GC6szVeEoS/MZ+qylwpKNKv9Z469UOjqCjwlusicyTxG6VpNxcQ8IncoR4RhLbR+NdpGGmJWOcIzJGUuKPGpQg8rrG21dOMqQssJQ4RxH5jaUqnZuQ0F4Q+cjxLwPtpZbIAk3QTJHQWBE5S1BokoVtDd6lhqr9UpHSUxMcIYl9pojsb8h4SBOsMQcqvOWC2E8EVehqiJ1hrrAEbQxeK0NGZ0Gkq+guSRgniM23bIHVkqwx4hiHd7smaOyglyIyQuM978j4VS08J/A2G1KeMBRo4fBaSNhKUEZfQewVQ/C1I+MgfbEleEzCUw7mKXI0M3hd1EESVji8x5uQ41nxs1q4RMJCCXs7Iq9acpxn22oSDnQ/sJTxsCbHIYZiLyhY05TY0ZLIOQrGaSJDDN4t8pVaIrsqqFdEegtizc1iTew5Q4ayBDMUsQMkXocaYkc0hZua412siZ1rSXlR460zRJ5SlHGe5j801RLMlJTxtaOM3Q1pvxJ45zUlWFD7rsAbpfEm1JHxG0eh8w2R7QQVzBUw28FhFp5QZzq8t2rx2joqulYTWSuJdTYfWwqMFMcovFmSyJPNyLhE4E10pHzYjOC3huArRa571ZsGajQpQx38SBP5pyZB6lMU3khDnp0MBV51BE9o2E+TY5Ml2E8S7C0o6w1xvCZjf0HkVEHCzFoyNmqC+9wdcqN+Tp7jSDheE9ws8Y5V0NJCn2bk2tqSY4okdrEhx1iDN8cSudwepWmAGXKcJXK65H9to8jYQRH7SBF01ESUJdd0TayVInaWhLkOjlXE5irKGOnI6GSWGCJa482zBI9rCr0jyTVcEuzriC1vcr6mwFGSiqy5zMwxBH/TJHwjSPhL8+01kaaSUuMFKTcLEvaUePcrSmwn8DZrgikWb7CGPxkSjhQwrRk57tctmxLsb9sZvL9LSlyuSLlWkqOjwduo8b6Uv1DkmudIeFF2dHCgxVtk8dpIvHpBxhEOdhKk7OLIUSdJ+cSRY57B+0DgGUUlNfpthTfGkauzxrvTsUUaCVhlKeteTXCoJDCa2NOKhOmC4G1H8JBd4OBZReSRGkqcb/CO1PyLJTLB4j1q8JYaIutEjSLX8YKM+a6phdMsdLFUoV5RTm9JSkuDN8WcIon0NZMNZWh1q8C7SJEwV5HxrmnnTrf3KoJBlmCYI2ilSLlfEvlE4011NNgjgthzEua0oKK7JLE7HZHlEl60BLMVFewg4EWNt0ThrVNEVkkiTwpKXSWJzdRENgvKGq4IhjsiezgSFtsfCUq8qki5S1LRQeYQQ4nemmCkImWMw3tFUoUBZk4NOeZYEp4XRKTGa6wJjrWNHBVJR4m3FCnbuD6aak2WsMTh3SZImGCIPKNgsDpVwnsa70K31lCFJZYcwwSMFcQulGTsZuEaSdBXkPGZhu0FsdUO73RHjq8MPGGIfaGIbVTk6iuI3GFgucHrIQkmWSJdBd7BBu+uOryWAhY7+Lki9rK5wtEQzWwvtbqGhIMFwWRJsElsY4m9IIg9L6lCX0VklaPAYkfkZEGDnOWowlBJjtMUkcGK4Lg6EtoZInMUBVYLgn0UsdmCyCz7gIGHFfk+k1QwTh5We7A9x+IdJ6CvIkEagms0hR50eH9UnTQJ+2oiKyVlLFUE+8gBGu8MQ3CppUHesnjTHN4QB/UGPhCTHLFPHMFrCqa73gqObUJGa03wgbhHkrCfpEpzNLE7JDS25FMKhlhKKWKfCgqstLCPu1zBXy0J2ztwjtixBu8UTRn9LVtkmCN2iyFhtME70JHRQ1KVZXqKI/KNIKYMCYs1GUMEKbM1bKOI9LDXC7zbHS+bt+1MTWS9odA9DtrYtpbImQJ2VHh/lisEwaHqUk1kjKTAKknkBEXkbkdMGwq0dnhzLJF3NJH3JVwrqOB4Sca2hti75nmJN0WzxS6UxDYoEpxpa4htVlRjkYE7DZGzJVU72uC9IyhQL4i8YfGWSYLLNcHXloyz7QhNifmKSE9JgfGmuyLhc403Xm9vqcp6gXe3xuuv8F6VJNxkyTHEkHG2g0aKXL0MsXc1bGfgas2//dCONXiNLCX+5mB7eZIl1kHh7ajwpikyzlUUWOVOsjSQlsS+M0R+pPje/dzBXRZGO0rMtgQrLLG9VSu9n6CMXS3BhwYmSoIBhsjNBmZbgusE9BCPCP5triU4VhNbJfE+swSP27aayE8tuTpYYjtrYjMVGZdp2NpS1s6aBnKSHDsbKuplKbHM4a0wMFd/5/DmGyKrJSUaW4IBrqUhx0vyfzTBBLPIUcnZdrAkNsKR0sWRspumSns6Ch0v/qqIbBYUWKvPU/CFoyrDJGwSNFhbA/MlzKqjrO80hRbpKx0Jewsi/STftwGSlKc1JZyAzx05dhLEdnfQvhZOqiHWWEAHC7+30FuRcZUgaO5gpaIK+xsiHRUsqaPElTV40xQZQ107Q9BZE1nryDVGU9ZSQ47bmhBpLcYpUt7S+xuK/FiT8qKjwXYw5ypS2iuCv7q1gtgjhuBuB8LCFY5cUuCNtsQOFcT+4Ih9JX+k8Ea6v0iCIRZOtCT0Et00JW5UeC85Cg0ScK0k411HcG1zKtre3SeITBRk7WfwDhEvaYLTHP9le0m8By0JDwn4TlLW/aJOvGHxdjYUes+ScZigCkYQdNdEOhkiezgShqkx8ueKjI8lDfK2oNiOFvrZH1hS+tk7NV7nOmLHicGWEgubkXKdwdtZknCLJXaCpkrjZBtLZFsDP9CdxWsSr05Sxl6CMmoFbCOgryX40uDtamB7SVmXW4Ihlgpmq+00tBKUUa83WbjLUNkzDmY7cow1JDygyPGlhgGKYKz4vcV7QBNbJIgM11TUqZaMdwTeSguH6rOaw1JRKzaaGyxVm2EJ/uCIrVWUcZUkcp2grMsEjK+DMwS59jQk3Kd6SEq1d0S6uVmO4Bc1lDXTUcHjluCXEq+1OlBDj1pi9zgiXxnKuE0SqTXwhqbETW6RggMEnGl/q49UT2iCzgJvRwVXS2K/d6+ZkyUl7jawSVLit46EwxVljDZwoSQ20sDBihztHfk2yA8NVZghiXwrYHQdfKAOtzsayjhY9bY0yE2CWEeJ9xfzO423xhL5syS2TFJofO2pboHob0nY4GiAgRrvGQEDa/FWSsoaaYl0syRsEt3kWoH3B01shCXhTUWe9w3Bt44SC9QCh3eShQctwbaK2ApLroGCMlZrYqvlY3qYhM0aXpFkPOuoqJ3Dm6fxXrGwVF9gCWZagjPqznfkuMKQ8DPTQRO8ZqG1hPGKEm9IgpGW4DZDgTNriTxvFiq+Lz+0cKfp4wj6OCK9JSnzNSn9LFU7UhKZZMnYwcJ8s8yRsECScK4j5UOB95HFO0CzhY4xJxuCix0lDlEUeMdS6EZBkTsUkZ4K74dugyTXS7aNgL8aqjDfkCE0ZbwkCXpaWCKhl8P7VD5jxykivSyxyZrYERbe168LYu9ZYh86IkscgVLE7tWPKmJv11CgoyJltMEbrohtVAQfO4ImltiHEroYEs7RxAarVpY8AwXMcMReFOTYWe5iiLRQxJ5Q8DtJ8LQhWOhIeFESPGsILhbNDRljNbHzNRlTFbk2S3L0NOS6V1KFJYKUbSTcIIhM0wQ/s2TM0SRMNcQmSap3jCH4yhJZKSkwyRHpYYgsFeQ4U7xoCB7VVOExhXepo9ABBsYbvGWKXPME3lyH95YioZ0gssQRWWbI+FaSMkXijZXwgiTlYdPdkNLaETxlyDVIwqeaEus0aTcYcg0RVOkpR3CSJqIddK+90JCxzsDVloyrFd5ZAr4TBKfaWa6boEA7C7s6EpYaeFPjveooY72mjIccLHJ9HUwVlDhKkmutJDJBwnp1rvulJZggKDRfbXAkvC/4l3ozQOG9a8lxjx0i7nV4jSXc7vhe3OwIxjgSHjdEhhsif9YkPGlus3iLFDnWOFhtCZbJg0UbQcIaR67JjthoCyMEZRwhiXWyxO5QxI6w5NhT4U1WsJvDO60J34fW9hwzwlKij6ZAW9ne4L0s8C6XeBMEkd/LQy1VucBRot6QMlbivaBhoBgjqGiCJNhsqVp/S2SsG6DIONCR0dXhvWbJ+MRRZJkkuEjgDXJjFQW6SSL7GXK8Z2CZg7cVsbWGoKmEpzQ5elpiy8Ryg7dMkLLUEauzeO86CuwlSOlgYLojZWeJ9xM3S1PWfEfKl5ISLQ0MEKR8YOB2QfCxJBjrKPCN4f9MkaSsqoVXJBmP7EpFZ9UQfOoOFwSzBN4MQ8LsGrymlipcJQhmy0GaQjPqCHaXRwuCZwRbqK2Fg9wlClZqYicrIgMdZfxTQ0c7TBIbrChxmuzoKG8XRaSrIhhiyNFJkrC7oIAWMEOQa5aBekPCRknCo4IKPrYkvCDI8aYmY7WFtprgekcJZ3oLIqssCSMtFbQTJKwXYy3BY5oCh2iKPCpJOE+zRdpYgi6O2KmOAgvVCYaU4ySRek1sgyFhJ403QFHiVEmJHwtybO1gs8Hr5+BETQX3War0qZngYGgtVZtoqd6vFSk/UwdZElYqyjrF4HXUeFspIi9IGKf4j92pKGAdCYMVsbcV3kRF0N+R8LUd5PCsIGWoxDtBkCI0nKofdJQxT+LtZflvuc8Q3CjwWkq8KwUpHzkK/NmSsclCL0nseQdj5FRH5CNHSgtLiW80Of5HU9Hhlsga9bnBq3fEVltKfO5IaSTmGjjc4J0otcP7QsJUSQM8pEj5/wCuUuC2DWz8AAAAAElFTkSuQmCC"); +} diff --git a/MixERP.Net.FrontEnd/Scripts/CodeMirror/theme/blackboard.css b/MixERP.Net.FrontEnd/Scripts/CodeMirror/theme/blackboard.css new file mode 100644 index 000000000..f2bde690c --- /dev/null +++ b/MixERP.Net.FrontEnd/Scripts/CodeMirror/theme/blackboard.css @@ -0,0 +1,25 @@ +/* Port of TextMate's Blackboard theme */ + +.cm-s-blackboard.CodeMirror { background: #0C1021; color: #F8F8F8; } +.cm-s-blackboard .CodeMirror-selected { background: #253B76 !important; } +.cm-s-blackboard .CodeMirror-gutters { background: #0C1021; border-right: 0; } +.cm-s-blackboard .CodeMirror-linenumber { color: #888; } +.cm-s-blackboard .CodeMirror-cursor { border-left: 1px solid #A7A7A7 !important; } + +.cm-s-blackboard .cm-keyword { color: #FBDE2D; } +.cm-s-blackboard .cm-atom { color: #D8FA3C; } +.cm-s-blackboard .cm-number { color: #D8FA3C; } +.cm-s-blackboard .cm-def { color: #8DA6CE; } +.cm-s-blackboard .cm-variable { color: #FF6400; } +.cm-s-blackboard .cm-operator { color: #FBDE2D;} +.cm-s-blackboard .cm-comment { color: #AEAEAE; } +.cm-s-blackboard .cm-string { color: #61CE3C; } +.cm-s-blackboard .cm-string-2 { color: #61CE3C; } +.cm-s-blackboard .cm-meta { color: #D8FA3C; } +.cm-s-blackboard .cm-error { background: #9D1E15; color: #F8F8F8; } +.cm-s-blackboard .cm-builtin { color: #8DA6CE; } +.cm-s-blackboard .cm-tag { color: #8DA6CE; } +.cm-s-blackboard .cm-attribute { color: #8DA6CE; } +.cm-s-blackboard .cm-header { color: #FF6400; } +.cm-s-blackboard .cm-hr { color: #AEAEAE; } +.cm-s-blackboard .cm-link { color: #8DA6CE; } diff --git a/MixERP.Net.FrontEnd/Scripts/CodeMirror/theme/cobalt.css b/MixERP.Net.FrontEnd/Scripts/CodeMirror/theme/cobalt.css new file mode 100644 index 000000000..6095799f3 --- /dev/null +++ b/MixERP.Net.FrontEnd/Scripts/CodeMirror/theme/cobalt.css @@ -0,0 +1,18 @@ +.cm-s-cobalt.CodeMirror { background: #002240; color: white; } +.cm-s-cobalt div.CodeMirror-selected { background: #b36539 !important; } +.cm-s-cobalt .CodeMirror-gutters { background: #002240; border-right: 1px solid #aaa; } +.cm-s-cobalt .CodeMirror-linenumber { color: #d0d0d0; } +.cm-s-cobalt .CodeMirror-cursor { border-left: 1px solid white !important; } + +.cm-s-cobalt span.cm-comment { color: #08f; } +.cm-s-cobalt span.cm-atom { color: #845dc4; } +.cm-s-cobalt span.cm-number, .cm-s-cobalt span.cm-attribute { color: #ff80e1; } +.cm-s-cobalt span.cm-keyword { color: #ffee80; } +.cm-s-cobalt span.cm-string { color: #3ad900; } +.cm-s-cobalt span.cm-meta { color: #ff9d00; } +.cm-s-cobalt span.cm-variable-2, .cm-s-cobalt span.cm-tag { color: #9effff; } +.cm-s-cobalt span.cm-variable-3, .cm-s-cobalt span.cm-def { color: white; } +.cm-s-cobalt span.cm-error { color: #9d1e15; } +.cm-s-cobalt span.cm-bracket { color: #d8d8d8; } +.cm-s-cobalt span.cm-builtin, .cm-s-cobalt span.cm-special { color: #ff9e59; } +.cm-s-cobalt span.cm-link { color: #845dc4; } diff --git a/MixERP.Net.FrontEnd/Scripts/CodeMirror/theme/default.css b/MixERP.Net.FrontEnd/Scripts/CodeMirror/theme/default.css new file mode 100644 index 000000000..b3bd02e0b --- /dev/null +++ b/MixERP.Net.FrontEnd/Scripts/CodeMirror/theme/default.css @@ -0,0 +1,43 @@ +.cm-s-default span.cm-keyword {color: #708;} +.cm-s-default span.cm-atom {color: #219;} +.cm-s-default span.cm-number +{ + color: #0000CC; +} +.cm-s-default span.cm-def {color: #00f;} +.cm-s-default span.cm-variable +{ + color: #FF3300; +} +.cm-s-default span.cm-variable-2 {color: #05a;} +.cm-s-default span.cm-variable-3 +{ + color: #FF3300; +} +.cm-s-default span.cm-property {color: black;} +.cm-s-default span.cm-operator {color: black;} +.cm-s-default span.cm-comment +{ + color: #009100; +} +.cm-s-default span.cm-string +{ + color: #0E12C5; +} +.cm-s-default span.cm-string-2 {color: #f50;} +.cm-s-default span.cm-meta {color: #555;} +.cm-s-default span.cm-error {color: #f00;} +.cm-s-default span.cm-qualifier {color: #555;} +.cm-s-default span.cm-builtin +{ + color: #FF3300; +} +.cm-s-default span.cm-bracket {color: #cc7;} +.cm-s-default span.cm-tag +{ + color: #800000; +} +.cm-s-default span.cm-attribute +{ + color: #E60000; +} \ No newline at end of file diff --git a/MixERP.Net.FrontEnd/Scripts/CodeMirror/theme/eclipse.css b/MixERP.Net.FrontEnd/Scripts/CodeMirror/theme/eclipse.css new file mode 100644 index 000000000..4137bbe26 --- /dev/null +++ b/MixERP.Net.FrontEnd/Scripts/CodeMirror/theme/eclipse.css @@ -0,0 +1,25 @@ +.cm-s-eclipse span.cm-meta {color: #FF1717;} +.cm-s-eclipse span.cm-keyword { line-height: 1em; font-weight: bold; color: #7F0055; } +.cm-s-eclipse span.cm-atom {color: #219;} +.cm-s-eclipse span.cm-number {color: #164;} +.cm-s-eclipse span.cm-def {color: #00f;} +.cm-s-eclipse span.cm-variable {color: black;} +.cm-s-eclipse span.cm-variable-2 {color: #0000C0;} +.cm-s-eclipse span.cm-variable-3 {color: #0000C0;} +.cm-s-eclipse span.cm-property {color: black;} +.cm-s-eclipse span.cm-operator {color: black;} +.cm-s-eclipse span.cm-comment {color: #3F7F5F;} +.cm-s-eclipse span.cm-string {color: #2A00FF;} +.cm-s-eclipse span.cm-string-2 {color: #f50;} +.cm-s-eclipse span.cm-error {color: #f00;} +.cm-s-eclipse span.cm-qualifier {color: #555;} +.cm-s-eclipse span.cm-builtin {color: #30a;} +.cm-s-eclipse span.cm-bracket {color: #cc7;} +.cm-s-eclipse span.cm-tag {color: #170;} +.cm-s-eclipse span.cm-attribute {color: #00c;} +.cm-s-eclipse span.cm-link {color: #219;} + +.cm-s-eclipse .CodeMirror-matchingbracket { + outline:1px solid grey; + color:black !important; +} diff --git a/MixERP.Net.FrontEnd/Scripts/CodeMirror/theme/elegant.css b/MixERP.Net.FrontEnd/Scripts/CodeMirror/theme/elegant.css new file mode 100644 index 000000000..d0ce0cb56 --- /dev/null +++ b/MixERP.Net.FrontEnd/Scripts/CodeMirror/theme/elegant.css @@ -0,0 +1,10 @@ +.cm-s-elegant span.cm-number, .cm-s-elegant span.cm-string, .cm-s-elegant span.cm-atom {color: #762;} +.cm-s-elegant span.cm-comment {color: #262; font-style: italic; line-height: 1em;} +.cm-s-elegant span.cm-meta {color: #555; font-style: italic; line-height: 1em;} +.cm-s-elegant span.cm-variable {color: black;} +.cm-s-elegant span.cm-variable-2 {color: #b11;} +.cm-s-elegant span.cm-qualifier {color: #555;} +.cm-s-elegant span.cm-keyword {color: #730;} +.cm-s-elegant span.cm-builtin {color: #30a;} +.cm-s-elegant span.cm-error {background-color: #fdd;} +.cm-s-elegant span.cm-link {color: #762;} diff --git a/MixERP.Net.FrontEnd/Scripts/CodeMirror/theme/erlang-dark.css b/MixERP.Net.FrontEnd/Scripts/CodeMirror/theme/erlang-dark.css new file mode 100644 index 000000000..cf5bf2bd6 --- /dev/null +++ b/MixERP.Net.FrontEnd/Scripts/CodeMirror/theme/erlang-dark.css @@ -0,0 +1,21 @@ +.cm-s-erlang-dark.CodeMirror { background: #002240; color: white; } +.cm-s-erlang-dark div.CodeMirror-selected { background: #b36539 !important; } +.cm-s-erlang-dark .CodeMirror-gutters { background: #002240; border-right: 1px solid #aaa; } +.cm-s-erlang-dark .CodeMirror-linenumber { color: #d0d0d0; } +.cm-s-erlang-dark .CodeMirror-cursor { border-left: 1px solid white !important; } + +.cm-s-erlang-dark span.cm-atom { color: #845dc4; } +.cm-s-erlang-dark span.cm-attribute { color: #ff80e1; } +.cm-s-erlang-dark span.cm-bracket { color: #ff9d00; } +.cm-s-erlang-dark span.cm-builtin { color: #eaa; } +.cm-s-erlang-dark span.cm-comment { color: #77f; } +.cm-s-erlang-dark span.cm-def { color: #e7a; } +.cm-s-erlang-dark span.cm-error { color: #9d1e15; } +.cm-s-erlang-dark span.cm-keyword { color: #ffee80; } +.cm-s-erlang-dark span.cm-meta { color: #50fefe; } +.cm-s-erlang-dark span.cm-number { color: #ffd0d0; } +.cm-s-erlang-dark span.cm-operator { color: #d11; } +.cm-s-erlang-dark span.cm-string { color: #3ad900; } +.cm-s-erlang-dark span.cm-tag { color: #9effff; } +.cm-s-erlang-dark span.cm-variable { color: #50fe50; } +.cm-s-erlang-dark span.cm-variable-2 { color: #e0e; } diff --git a/MixERP.Net.FrontEnd/Scripts/CodeMirror/theme/lesser-dark.css b/MixERP.Net.FrontEnd/Scripts/CodeMirror/theme/lesser-dark.css new file mode 100644 index 000000000..67f71ad72 --- /dev/null +++ b/MixERP.Net.FrontEnd/Scripts/CodeMirror/theme/lesser-dark.css @@ -0,0 +1,44 @@ +/* +http://lesscss.org/ dark theme +Ported to CodeMirror by Peter Kroon +*/ +.cm-s-lesser-dark { + line-height: 1.3em; +} +.cm-s-lesser-dark { + font-family: 'Bitstream Vera Sans Mono', 'DejaVu Sans Mono', 'Monaco', Courier, monospace !important; +} + +.cm-s-lesser-dark.CodeMirror { background: #262626; color: #EBEFE7; text-shadow: 0 -1px 1px #262626; } +.cm-s-lesser-dark div.CodeMirror-selected {background: #45443B !important;} /* 33322B*/ +.cm-s-lesser-dark .CodeMirror-cursor { border-left: 1px solid white !important; } +.cm-s-lesser-dark pre { padding: 0 8px; }/*editable code holder*/ + +div.CodeMirror span.CodeMirror-matchingbracket { color: #7EFC7E; }/*65FC65*/ + +.cm-s-lesser-dark .CodeMirror-gutters { background: #262626; border-right:1px solid #aaa; } +.cm-s-lesser-dark .CodeMirror-linenumber { color: #777; } + +.cm-s-lesser-dark span.cm-keyword { color: #599eff; } +.cm-s-lesser-dark span.cm-atom { color: #C2B470; } +.cm-s-lesser-dark span.cm-number { color: #B35E4D; } +.cm-s-lesser-dark span.cm-def {color: white;} +.cm-s-lesser-dark span.cm-variable { color:#D9BF8C; } +.cm-s-lesser-dark span.cm-variable-2 { color: #669199; } +.cm-s-lesser-dark span.cm-variable-3 { color: white; } +.cm-s-lesser-dark span.cm-property {color: #92A75C;} +.cm-s-lesser-dark span.cm-operator {color: #92A75C;} +.cm-s-lesser-dark span.cm-comment { color: #666; } +.cm-s-lesser-dark span.cm-string { color: #BCD279; } +.cm-s-lesser-dark span.cm-string-2 {color: #f50;} +.cm-s-lesser-dark span.cm-meta { color: #738C73; } +.cm-s-lesser-dark span.cm-error { color: #9d1e15; } +.cm-s-lesser-dark span.cm-qualifier {color: #555;} +.cm-s-lesser-dark span.cm-builtin { color: #ff9e59; } +.cm-s-lesser-dark span.cm-bracket { color: #EBEFE7; } +.cm-s-lesser-dark span.cm-tag { color: #669199; } +.cm-s-lesser-dark span.cm-attribute {color: #00c;} +.cm-s-lesser-dark span.cm-header {color: #a0a;} +.cm-s-lesser-dark span.cm-quote {color: #090;} +.cm-s-lesser-dark span.cm-hr {color: #999;} +.cm-s-lesser-dark span.cm-link {color: #00c;} diff --git a/MixERP.Net.FrontEnd/Scripts/CodeMirror/theme/midnight.css b/MixERP.Net.FrontEnd/Scripts/CodeMirror/theme/midnight.css new file mode 100644 index 000000000..e567625c6 --- /dev/null +++ b/MixERP.Net.FrontEnd/Scripts/CodeMirror/theme/midnight.css @@ -0,0 +1,52 @@ +/* Based on the theme at http://bonsaiden.github.com/JavaScript-Garden */ + +/**/ +.breakpoints {width: .8em;} +.breakpoint { color: #822; } + +/**/ +span.CodeMirror-matchhighlight { background: #494949 } +.CodeMirror-focused span.CodeMirror-matchhighlight { background: #314D67; !important } + +/**/ +.activeline {background: #253540 !important;} + +.cm-s-midnight.CodeMirror { + background: #0F192A; + color: #D1EDFF; +} + +.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;} + +.cm-s-midnight div.CodeMirror-selected {background: #314D67 !important;} +.cm-s-midnight .CodeMirror-gutters {background: #0F192A; border-right: 1px solid;} +.cm-s-midnight .CodeMirror-linenumber {color: #D0D0D0;} +.cm-s-midnight .CodeMirror-cursor { + border-left: 1px solid #F8F8F0 !important; +} + +.cm-s-midnight span.cm-comment {color: #428BDD;} +.cm-s-midnight span.cm-atom {color: #AE81FF;} +.cm-s-midnight span.cm-number {color: #D1EDFF;} + +.cm-s-midnight span.cm-property, .cm-s-tropicaleve span.cm-attribute {color: #A6E22E;} +.cm-s-midnight span.cm-keyword {color: #E83737;} +.cm-s-midnight span.cm-string {color: #1DC116;} + +.cm-s-midnight span.cm-variable {color: #FFAA3E;} +.cm-s-midnight span.cm-variable-2 {color: #FFAA3E;} +.cm-s-midnight span.cm-def {color: #4DD;} +.cm-s-midnight span.cm-error {background: #F92672; color: #F8F8F0;} +.cm-s-midnight span.cm-bracket {color: #D1EDFF;} +.cm-s-midnight span.cm-tag {color: #008;} +.cm-s-midnight span.cm-link {color: #AE81FF;} + +.cm-s-midnight .CodeMirror-matchingbracket { + text-decoration: underline; + color: white !important; +} + +.typ { color: #FFAA3E; } +.atn { color: #606; } +.atv { color: #080; } +.dec { color: #606; } diff --git a/MixERP.Net.FrontEnd/Scripts/CodeMirror/theme/monokai.css b/MixERP.Net.FrontEnd/Scripts/CodeMirror/theme/monokai.css new file mode 100644 index 000000000..a0b3c7c0a --- /dev/null +++ b/MixERP.Net.FrontEnd/Scripts/CodeMirror/theme/monokai.css @@ -0,0 +1,28 @@ +/* Based on Sublime Text's Monokai theme */ + +.cm-s-monokai.CodeMirror {background: #272822; color: #f8f8f2;} +.cm-s-monokai div.CodeMirror-selected {background: #49483E !important;} +.cm-s-monokai .CodeMirror-gutters {background: #272822; border-right: 0px;} +.cm-s-monokai .CodeMirror-linenumber {color: #d0d0d0;} +.cm-s-monokai .CodeMirror-cursor {border-left: 1px solid #f8f8f0 !important;} + +.cm-s-monokai span.cm-comment {color: #75715e;} +.cm-s-monokai span.cm-atom {color: #ae81ff;} +.cm-s-monokai span.cm-number {color: #ae81ff;} + +.cm-s-monokai span.cm-property, .cm-s-monokai span.cm-attribute {color: #a6e22e;} +.cm-s-monokai span.cm-keyword {color: #f92672;} +.cm-s-monokai span.cm-string {color: #e6db74;} + +.cm-s-monokai span.cm-variable {color: #a6e22e;} +.cm-s-monokai span.cm-variable-2 {color: #9effff;} +.cm-s-monokai span.cm-def {color: #fd971f;} +.cm-s-monokai span.cm-error {background: #f92672; color: #f8f8f0;} +.cm-s-monokai span.cm-bracket {color: #f8f8f2;} +.cm-s-monokai span.cm-tag {color: #f92672;} +.cm-s-monokai span.cm-link {color: #ae81ff;} + +.cm-s-monokai .CodeMirror-matchingbracket { + text-decoration: underline; + color: white !important; +} diff --git a/MixERP.Net.FrontEnd/Scripts/CodeMirror/theme/neat.css b/MixERP.Net.FrontEnd/Scripts/CodeMirror/theme/neat.css new file mode 100644 index 000000000..8a307f802 --- /dev/null +++ b/MixERP.Net.FrontEnd/Scripts/CodeMirror/theme/neat.css @@ -0,0 +1,9 @@ +.cm-s-neat span.cm-comment { color: #a86; } +.cm-s-neat span.cm-keyword { line-height: 1em; font-weight: bold; color: blue; } +.cm-s-neat span.cm-string { color: #a22; } +.cm-s-neat span.cm-builtin { line-height: 1em; font-weight: bold; color: #077; } +.cm-s-neat span.cm-special { line-height: 1em; font-weight: bold; color: #0aa; } +.cm-s-neat span.cm-variable { color: black; } +.cm-s-neat span.cm-number, .cm-s-neat span.cm-atom { color: #3a3; } +.cm-s-neat span.cm-meta {color: #555;} +.cm-s-neat span.cm-link { color: #3a3; } diff --git a/MixERP.Net.FrontEnd/Scripts/CodeMirror/theme/night.css b/MixERP.Net.FrontEnd/Scripts/CodeMirror/theme/night.css new file mode 100644 index 000000000..8804a399a --- /dev/null +++ b/MixERP.Net.FrontEnd/Scripts/CodeMirror/theme/night.css @@ -0,0 +1,21 @@ +/* Loosely based on the Midnight Textmate theme */ + +.cm-s-night.CodeMirror { background: #0a001f; color: #f8f8f8; } +.cm-s-night div.CodeMirror-selected { background: #447 !important; } +.cm-s-night .CodeMirror-gutters { background: #0a001f; border-right: 1px solid #aaa; } +.cm-s-night .CodeMirror-linenumber { color: #f8f8f8; } +.cm-s-night .CodeMirror-cursor { border-left: 1px solid white !important; } + +.cm-s-night span.cm-comment { color: #6900a1; } +.cm-s-night span.cm-atom { color: #845dc4; } +.cm-s-night span.cm-number, .cm-s-night span.cm-attribute { color: #ffd500; } +.cm-s-night span.cm-keyword { color: #599eff; } +.cm-s-night span.cm-string { color: #37f14a; } +.cm-s-night span.cm-meta { color: #7678e2; } +.cm-s-night span.cm-variable-2, .cm-s-night span.cm-tag { color: #99b2ff; } +.cm-s-night span.cm-variable-3, .cm-s-night span.cm-def { color: white; } +.cm-s-night span.cm-error { color: #9d1e15; } +.cm-s-night span.cm-bracket { color: #8da6ce; } +.cm-s-night span.cm-comment { color: #6900a1; } +.cm-s-night span.cm-builtin, .cm-s-night span.cm-special { color: #ff9e59; } +.cm-s-night span.cm-link { color: #845dc4; } diff --git a/MixERP.Net.FrontEnd/Scripts/CodeMirror/theme/rubyblue.css b/MixERP.Net.FrontEnd/Scripts/CodeMirror/theme/rubyblue.css new file mode 100644 index 000000000..23c0cc74e --- /dev/null +++ b/MixERP.Net.FrontEnd/Scripts/CodeMirror/theme/rubyblue.css @@ -0,0 +1,21 @@ +.cm-s-rubyblue { font-family: Trebuchet, Verdana, sans-serif; } /* - customized editor font - */ + +.cm-s-rubyblue.CodeMirror { background: #112435; color: white; } +.cm-s-rubyblue div.CodeMirror-selected { background: #38566F !important; } +.cm-s-rubyblue .CodeMirror-gutters { background: #1F4661; border-right: 7px solid #3E7087; } +.cm-s-rubyblue .CodeMirror-linenumber { color: white; } +.cm-s-rubyblue .CodeMirror-cursor { border-left: 1px solid white !important; } + +.cm-s-rubyblue span.cm-comment { color: #999; font-style:italic; line-height: 1em; } +.cm-s-rubyblue span.cm-atom { color: #F4C20B; } +.cm-s-rubyblue span.cm-number, .cm-s-rubyblue span.cm-attribute { color: #82C6E0; } +.cm-s-rubyblue span.cm-keyword { color: #F0F; } +.cm-s-rubyblue span.cm-string { color: #F08047; } +.cm-s-rubyblue span.cm-meta { color: #F0F; } +.cm-s-rubyblue span.cm-variable-2, .cm-s-rubyblue span.cm-tag { color: #7BD827; } +.cm-s-rubyblue span.cm-variable-3, .cm-s-rubyblue span.cm-def { color: white; } +.cm-s-rubyblue span.cm-error { color: #AF2018; } +.cm-s-rubyblue span.cm-bracket { color: #F0F; } +.cm-s-rubyblue span.cm-link { color: #F4C20B; } +.cm-s-rubyblue span.CodeMirror-matchingbracket { color:#F0F !important; } +.cm-s-rubyblue span.cm-builtin, .cm-s-rubyblue span.cm-special { color: #FF9D00; } diff --git a/MixERP.Net.FrontEnd/Scripts/CodeMirror/theme/solarized.css b/MixERP.Net.FrontEnd/Scripts/CodeMirror/theme/solarized.css new file mode 100644 index 000000000..06a6c7fa1 --- /dev/null +++ b/MixERP.Net.FrontEnd/Scripts/CodeMirror/theme/solarized.css @@ -0,0 +1,207 @@ +/* +Solarized theme for code-mirror +http://ethanschoonover.com/solarized +*/ + +/* +Solarized color pallet +http://ethanschoonover.com/solarized/img/solarized-palette.png +*/ + +.solarized.base03 { color: #002b36; } +.solarized.base02 { color: #073642; } +.solarized.base01 { color: #586e75; } +.solarized.base00 { color: #657b83; } +.solarized.base0 { color: #839496; } +.solarized.base1 { color: #93a1a1; } +.solarized.base2 { color: #eee8d5; } +.solarized.base3 { color: #fdf6e3; } +.solarized.solar-yellow { color: #b58900; } +.solarized.solar-orange { color: #cb4b16; } +.solarized.solar-red { color: #dc322f; } +.solarized.solar-magenta { color: #d33682; } +.solarized.solar-violet { color: #6c71c4; } +.solarized.solar-blue { color: #268bd2; } +.solarized.solar-cyan { color: #2aa198; } +.solarized.solar-green { color: #859900; } + +/* Color scheme for code-mirror */ + +.cm-s-solarized { + line-height: 1.45em; + font-family: Menlo,Monaco,"Andale Mono","lucida console","Courier New",monospace !important; + color-profile: sRGB; + rendering-intent: auto; +} +.cm-s-solarized.cm-s-dark { + color: #839496; + background-color: #002b36; + text-shadow: #002b36 0 1px; +} +.cm-s-solarized.cm-s-light { + background-color: #fdf6e3; + color: #657b83; + text-shadow: #eee8d5 0 1px; +} + +.cm-s-solarized .CodeMirror-widget { + text-shadow: none; +} + + +.cm-s-solarized .cm-keyword { color: #cb4b16 } +.cm-s-solarized .cm-atom { color: #d33682; } +.cm-s-solarized .cm-number { color: #d33682; } +.cm-s-solarized .cm-def { color: #2aa198; } + +.cm-s-solarized .cm-variable { color: #268bd2; } +.cm-s-solarized .cm-variable-2 { color: #b58900; } +.cm-s-solarized .cm-variable-3 { color: #6c71c4; } + +.cm-s-solarized .cm-property { color: #2aa198; } +.cm-s-solarized .cm-operator {color: #6c71c4;} + +.cm-s-solarized .cm-comment { color: #586e75; font-style:italic; } + +.cm-s-solarized .cm-string { color: #859900; } +.cm-s-solarized .cm-string-2 { color: #b58900; } + +.cm-s-solarized .cm-meta { color: #859900; } +.cm-s-solarized .cm-error, +.cm-s-solarized .cm-invalidchar { + color: #586e75; + border-bottom: 1px dotted #dc322f; +} +.cm-s-solarized .cm-qualifier { color: #b58900; } +.cm-s-solarized .cm-builtin { color: #d33682; } +.cm-s-solarized .cm-bracket { color: #cb4b16; } +.cm-s-solarized .CodeMirror-matchingbracket { color: #859900; } +.cm-s-solarized .CodeMirror-nonmatchingbracket { color: #dc322f; } +.cm-s-solarized .cm-tag { color: #93a1a1 } +.cm-s-solarized .cm-attribute { color: #2aa198; } +.cm-s-solarized .cm-header { color: #586e75; } +.cm-s-solarized .cm-quote { color: #93a1a1; } +.cm-s-solarized .cm-hr { + color: transparent; + border-top: 1px solid #586e75; + display: block; +} +.cm-s-solarized .cm-link { color: #93a1a1; cursor: pointer; } +.cm-s-solarized .cm-special { color: #6c71c4; } +.cm-s-solarized .cm-em { + color: #999; + text-decoration: underline; + text-decoration-style: dotted; +} +.cm-s-solarized .cm-strong { color: #eee; } +.cm-s-solarized .cm-tab:before { + content: "➤"; /*visualize tab character*/ + color: #586e75; +} + +.cm-s-solarized.cm-s-dark .CodeMirror-focused .CodeMirror-selected { + background: #386774; + color: inherit; +} + +.cm-s-solarized.cm-s-dark ::selection { + background: #386774; + color: inherit; +} + +.cm-s-solarized.cm-s-dark .CodeMirror-selected { + background: #586e75; +} + +.cm-s-solarized.cm-s-light .CodeMirror-focused .CodeMirror-selected { + background: #eee8d5; + color: inherit; +} + +.cm-s-solarized.cm-s-light ::selection { + background: #eee8d5; + color: inherit; +} + +.cm-s-solarized.cm-s-light .CodeMirror-selected { + background: #93a1a1; +} + + + +/* Editor styling */ + + + +/* Little shadow on the view-port of the buffer view */ +.cm-s-solarized.CodeMirror { + -moz-box-shadow: inset 7px 0 12px -6px #000; + -webkit-box-shadow: inset 7px 0 12px -6px #000; + box-shadow: inset 7px 0 12px -6px #000; +} + +/* Gutter border and some shadow from it */ +.cm-s-solarized .CodeMirror-gutters { + padding: 0 15px 0 10px; + box-shadow: 0 10px 20px black; + border-right: 1px solid; +} + +/* Gutter colors and line number styling based of color scheme (dark / light) */ + +/* Dark */ +.cm-s-solarized.cm-s-dark .CodeMirror-gutters { + background-color: #073642; + border-color: #00232c; +} + +.cm-s-solarized.cm-s-dark .CodeMirror-linenumber { + text-shadow: #021014 0 -1px; +} + +/* Light */ +.cm-s-solarized.cm-s-light .CodeMirror-gutters { + background-color: #eee8d5; + border-color: #eee8d5; +} + +/* Common */ +.cm-s-solarized .CodeMirror-linenumber { + color: #586e75; +} + +.cm-s-solarized .CodeMirror-gutter .CodeMirror-gutter-text { + color: #586e75; +} + +.cm-s-solarized .CodeMirror-lines { + padding-left: 5px; +} + +.cm-s-solarized .CodeMirror-lines .CodeMirror-cursor { + border-left: 1px solid #819090; +} + +/* +Active line. Negative margin compensates left padding of the text in the +view-port +*/ +.cm-s-solarized .activeline { + margin-left: -20px; +} + +.cm-s-solarized.cm-s-dark .activeline { + background: rgba(255, 255, 255, 0.05); + +} +.cm-s-solarized.cm-s-light .activeline { + background: rgba(0, 0, 0, 0.05); +} + +/* +View-port and gutter both get little noise background to give it a real feel. +*/ +.cm-s-solarized.CodeMirror, +.cm-s-solarized .CodeMirror-gutters { + background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMgAAADICAQAAAAHUWYVAABFFUlEQVQYGbzBCeDVU/74/6fj9HIcx/FRHx9JCFmzMyGRURhLZIkUsoeRfUjS2FNDtr6WkMhO9sm+S8maJfu+Jcsg+/o/c+Z4z/t97/vezy3z+z8ekGlnYICG/o7gdk+wmSHZ1z4pJItqapjoKXWahm8NmV6eOTbWUOp6/6a/XIg6GQqmenJ2lDHyvCFZ2cBDbmtHA043VFhHwXxClWmeYAdLhV00Bd85go8VmaFCkbVkzlQENzfBDZ5gtN7HwF0KDrTwJ0dypSOzpaKCMwQHKTIreYIxlmhXTzTWkVm+LTynZhiSBT3RZQ7aGfjGEd3qyXQ1FDymqbKxpspERQN2MiRjNZlFFQXfCNFm9nM1zpAsoYjmtRTc5ajwuaXc5xrWskT97RaKzAGe5ARHhVUsDbjKklziiX5WROcJwSNCNI+9w1Jwv4Zb2r7lCMZ4oq5C0EdTx+2GzNuKpJ+iFf38JEWkHJn9DNF7mmBDITrWEg0VWL3pHU20tSZnuqWu+R3BtYa8XxV1HO7GyD32UkOpL/yDloINFTmvtId+nmAjxRw40VMwVKiwrKLE4bK5UOVntYwhOcSSXKrJHKPJedocpGjVz/ZMIbnYUPB10/eKCrs5apqpgVmWzBYWpmtKHecJPjaUuEgRDDaU0oZghCJ6zNMQ5ZhDYx05r5v2muQdM0EILtXUsaKiQX9WMEUotagQzFbUNN6NUPC2nm5pxEWGCjMc3GdJHjSU2kORLK/JGSrkfGEIjncU/CYUnOipoYemwj8tST9NsJmB7TUVXtbUtXATJVZXBMvYeTXJfobgJUPmGMP/yFaWonaa6BcFO3nqcIqCozSZoZoSr1g4zJOzuyGnxTEX3lUEJ7WcZgme8ddaWvWJo2AJR9DZU3CUIbhCSG6ybSwN6qtJVnCU2svDTP2ZInOw2cBTrqtQahtNZn9NcJ4l2NaSmSkkP1noZWnVwkLmdUPOwLZEwy2Z3S3R+4rIG9hcbpPXHFVWcQdZkn2FOta3cKWQnNRC5g1LsJah4GCzSVsKnCOY5OAFRTBekyyryeyilhFKva75r4Mc0aWanGEaThcy31s439KKxTzJYY5WTHPU1FtIHjQU3Oip4xlNzj/lBw23dYZVliQa7WAXf4shetcQfatI+jWRDBPmyNeW6A1P5kdDgyYJlba0BIM8BZu1JfrFwItyjcAMR3K0BWOIrtMEXyhyrlVEx3ui5dUBjmB/Q3CXW85R4mBD0s7B+4q5tKUjOlb9qqmhi5AZ6GFIC5HXtOobdYGlVdMVbNJ8toNTFcHxnoL+muBagcctjWnbNMuR00uI7nQESwg5q2qqrKWIfrNUmeQocY6HuyxJV02wj36w00yhpmUFenv4p6fUkZYqLyuinx2RGOjhCXYyJF84oiU00YMOOhhquNdfbOB7gU88pY4xJO8LVdp6/q2voeB4R04vIdhSE40xZObx1HGGJ/ja0LBthFInKaLPPFzuCaYaoj8JjPME8yoyxo6zlBqkiUZYgq00OYMswbWO5NGmq+xhipxHLRW29ARjNKXO0wRnear8XSg4XFPLKEPUS1GqvyLwiuBUoa7zpZ0l5xxFwWmWZC1H5h5FwU8eQ7K+g8UcVY6TMQreVQT/8uQ8Z+ALIXnSEa2pYZQneE9RZbSBNYXfWYJzW/h/4j4Dp1tYVcFIC5019Vyi4ThPqSFCzjGWaHQTBU8q6vrVwgxP9Lkm840imWKpcLCjYTtrKuwvsKSnrvHCXGkSMk9p6lhckfRpIeis+N2PiszT+mFLspyGleUhDwcLrZqmyeylxwjBcKHEapqkmyangyLZRVOijwOtCY5SsG5zL0OwlCJ4y5KznF3EUNDDrinwiyLZRzOXtlBbK5ITHFGLp8Q0R6ab6mS7enI2cFrxOyHvOCFaT1HThS1krjCwqWeurCkk+willhCC+RSZnRXBiZaC5RXRIZYKp2lyfrHwiKPKR0JDzrdU2EFgpidawlFDR6FgXUMNa+g1FY3bUQh2cLCwosRdnuQTS/S+JVrGLeWIvtQUvONJxlqSQYYKpwoN2kaocLjdVsis4Mk80ESF2YpSkzwldjHkjFCUutI/r+EHDU8oCs6yzL3PhWiEooZdFMkymlas4AcI3KmoMMNSQ3tHzjGWCrcJJdYyZC7QFGwjRL9p+MrRkAGWzIaWCn9W0F3TsK01c2ZvQw0byvxuQU0r1lM0qJO7wW0kRIMdDTtXEdzi4VIh+EoIHm0mWtAtpCixlabgn83fKTI7anJe9ST7WIK1DMGpQmYeA58ImV6ezOGOzK2Kgq01pd60cKWiUi9Lievb/0vIDPHQ05Kzt4ddPckQBQtoaurjyHnek/nKzpQLrVgKPjIkh2v4uyezpv+Xoo7fPFXaGFp1vaLKxQ4uUpQQS5VuQs7BCq4xRJv7fwpVvvFEB3j+620haOuocqMhWd6TTPAEx+mdFNGHdranFe95WrWmIvlY4F1Dle2ECgc6cto7SryuqGGGha0tFQ5V53migUKmg6XKAo4qS3mik+0OZpAhOLeZKicacgaYcyx5hypYQE02ZA4xi/pNhOQxR4klNKyqacj+mpxnLTnnGSo85++3ZCZq6lrZkXlGEX3o+C9FieccJbZWVFjC0Yo1FZnJhoYMFoI1hEZ9r6hwg75HwzBNhbZCdJEfJwTPGzJvaKImw1yYX1HDAmpXR+ZJQ/SmgqMNVQb5vgamGwLtt7VwvP7Qk1xpiM5x5Cyv93E06MZmgs0Nya2azIKOYKCGBQQW97RmhKNKF02JZqHEJ4o58qp7X5EcZmc56trXEqzjCBZ1MFGR87Ql2tSTs6CGxS05PTzRQorkbw7aKoKXFDXsYW42VJih/q+FP2BdTzDTwVqOYB13liM50vG7wy28qagyuIXMeQI/Oqq8bcn5wJI50xH00CRntyfpL1T4hydYpoXgNiFzoIUTDZnLNRzh4TBHwbYGDvZkxmlyJloyr6tRihpeUG94GnKtIznREF0tzJG/OOr73JBcrSh1k6WuTprgLU+mnSGnv6Zge0NNz+kTDdH8nuAuTdJDCNb21LCiIuqlYbqGzT3RAoZofQfjFazkqeNWdYaGvYTM001EW2oKPvVk1ldUGSgUtHFwjKM1h9jnFcmy5lChoLNaQMGGDsYbKixlaMBmmsx1QjCfflwTfO/gckW0ruZ3jugKR3R5W9hGUWqCgxuFgsuaCHorotGKzGaeZB9DMsaTnKCpMtwTvOzhYk0rdrArKCqcaWmVk1+F372ur1YkKxgatI8Qfe1gIX9wE9FgS8ESmuABIXnRUbCapcKe+nO7slClSZFzpV/LkLncEb1qiO42fS3R855Su2mCLh62t1SYZZYVmKwIHjREF2uihTzB20JOkz7dkxzYQnK0UOU494wh+VWRc6Un2kpTaVgLDFEkJ/uhzRcI0YKGgpGWOlocBU/a4fKoJ/pEaNV6jip3+Es9VXY078rGnmAdf7t9ylPXS34RBSuYPs1UecZTU78WanhBCHpZ5sAoTz0LGZKjPf9TRypqWEiTvOFglL1fCEY3wY/++rbk7C8bWebA6p6om6PgOL2kp44TFJlVNBXae2rqqdZztOJpT87GQsE9jqCPIe9VReZuQ/CIgacsyZdCpIScSYqcZk8r+nsyCzhyfhOqHGOIvrLknC8wTpFcaYiGC/RU1NRbUeUpocQOnkRpGOrIOcNRx+1uA0UrzhSSt+VyS3SJpnFWkzNDqOFGIWcfR86DnmARTQ1HKIL33ExPiemeOhYSSjzlSUZZuE4TveoJLnBUOFof6KiysCbnAEcZgcUNTDOwkqWu3RWtmGpZwlHhJENdZ3miGz0lJlsKnjbwqSHQjpxnFDlTLLwqJPMZMjd7KrzkSG7VsxXBZE+F8YZkb01Oe00yyRK9psh5SYh29ySPKBo2ylNht7ZkZnsKenjKNJu9PNEyZpaCHv4Kt6RQsLvAVp7M9kIimmCUwGeWqLMmGuIotYMmWNpSahkhZw9FqZsVnKJhsjAHvtHMsTM9fCI06Dx/u3vfUXCqfsKRc4oFY2jMsoo/7DJDwZ1CsIKnJu+J9ldkpmiCxQx1rWjI+T9FwcWWzOuaYH0Hj7klNRVWEQpmaqosakiGNTFHdjS/qnUdmf0NJW5xsL0HhimCCZZSRzmSPTXJQ4aaztAwtZnoabebJ+htCaZ7Cm535ByoqXKbX1WRc4Eh2MkRXWzImVc96Cj4VdOKVxR84VdQsIUM8Psoou2byVHyZFuq7O8otbSQ2UAoeEWTudATLGSpZzVLlXVkPU2Jc+27lsw2jmg5T5VhbeE3BT083K9WsTTkFU/Osi0rC5lRlpwRHUiesNS0sOvmqGML1aRbPAxTJD9ZKtxuob+hhl8cwYGWpJ8nub7t5p6coYbMovZ1BTdaKn1jYD6h4GFDNFyT/Kqe1XCXphXHOKLZmuRSRdBPEfVUXQzJm5YGPGGJdvAEr7hHNdGZnuBvrpciGmopOLf5N0uVMy0FfYToJk90uUCbJupaVpO53UJXR2bVpoU00V2KOo4zMFrBd0Jtz2pa0clT5Q5L8IpQ177mWQejPMEJhuQjS10ref6HHjdEhy1P1EYR7GtO0uSsKJQYLiTnG1rVScj5lyazpqWGl5uBbRWl7m6ixGOOnEsMJR7z8J0n6KMnCdxhiNYQCoZ6CmYLnO8omC3MkW3bktlPmEt/VQQHejL3+dOE5FlPdK/Mq8hZxxJtLyRrepLThYKbLZxkSb5W52vYxNOaOxUF0yxMUPwBTYqCzy01XayYK0sJyWBLqX0MwU5CzoymRzV0EjjeUeLgDpTo6ij42ZAzvD01dHUUTPLU96MdLbBME8nFBn7zJCMtJcZokn8YoqU0FS5WFKyniHobguMcmW8N0XkWZjkyN3hqOMtS08r+/xTBwpZSZ3qiVRX8SzMHHjfUNFjgHEPmY9PL3ykEzxkSre/1ZD6z/NuznuB0RcE1TWTm9zRgfUWVJiG6yrzgmWPXC8EAR4Wxhlad0ZbgQyEz3pG5RVEwwDJH2mgKpjcTiCOzn1lfUWANFbZ2BA8balnEweJC9J0iuaeZoI+ippFCztEKVvckR2iice1JvhVytrQwUAZpgsubCPaU7xUe9vWnaOpaSBEspalykhC9bUlOMpT42ZHca6hyrqKmw/wMR8H5ZmdFoBVJb03O4UL0tSNnvIeRmkrLWqrs78gcrEn2tpcboh0UPOW3UUR9PMk4T4nnNKWmCjlrefhCwxRNztfmIQVdDElvS4m1/WuOujoZCs5XVOjtKPGokJzsYCtFYoWonSPT21DheU/wWhM19FcElwqNGOsp9Q8N/cwXaiND1MmeL1Q5XROtYYgGeFq1aTMsoMmcrKjQrOFQTQ1fmBYhmW6o8Jkjc7iDJRTBIo5kgJD5yMEYA3srCg7VFKwiVJkmRCc5ohGOKhsYMn/XBLdo5taZjlb9YAlGWRimqbCsoY7HFAXLa5I1HPRxMMsQDHFkWtRNniqT9UEeNjcE7RUlrCJ4R2CSJuqlKHWvJXjAUNcITYkenuBRB84TbeepcqTj3zZyFJzgYQdHnqfgI0ddUwS6GqWpsKWhjq9cV0vBAEMN2znq+EBfIWT+pClYw5xsTlJU6GeIBsjGmmANTzJZiIYpgrM0Oa8ZMjd7NP87jxhqGOhJlnQtjuQpB+8aEE00wZFznSJPyHxgH3HkPOsJFvYk8zqCHzTs1BYOa4J3PFU+UVRZxlHDM4YavlNUuMoRveiZA2d7grMNc2g+RbSCEKzmgYsUmWmazFJyoiOZ4KnyhKOGRzWJa0+moyV4TVHDzn51Awtqaphfk/lRQ08FX1iiqxTB/kLwd0VynKfEvI6cd4XMV5bMhZ7gZUWVzYQ6Nm2BYzxJbw3bGthEUUMfgbGeorae6DxHtJoZ6alhZ0+ytiVoK1R4z5PTrOECT/SugseEOlb1MMNR4VRNcJy+V1Hg9ONClSZFZjdHlc6W6FBLdJja2MC5hhpu0DBYEY1TFGwiFAxRRCsYkiM9JRb0JNMVkW6CZYT/2EiTGWmo8k+h4FhDNE7BvppoTSFnmCV5xZKzvcCdDo7VVPnIU+I+Rc68juApC90MwcFCsJ5hDqxgScYKreruyQwTqrzoqDCmhWi4IbhB0Yrt3RGa6GfDv52rKXWhh28dyZaWUvcZeMTBaZoSGyiCtRU5J8iviioHaErs7Jkj61syVzTTgOcUOQ8buFBTYWdL5g3T4qlpe0+wvD63heAXRfCCIed9RbCsp2CiI7raUOYOTU13N8PNHvpaGvayo4a3LLT1lDrVEPT2zLUlheB1R+ZTRfKWJ+dcocLJfi11vyJ51lLqJ0WD7tRwryezjiV5W28uJO9qykzX8JDe2lHl/9oyBwa2UMfOngpXCixvKdXTk3wrsKmiVYdZIqsoWEERjbcUNDuiaQomGoIbFdEHmsyWnuR+IeriKDVLnlawlyNHKwKlSU631PKep8J4Q+ayjkSLKYLhalNHlYvttb6fHm0p6OApsZ4l2VfdqZkjuysy6ysKLlckf1KUutCTs39bmCgEyyoasIWlVaMF7mgmWtBT8Kol5xpH9IGllo8cJdopcvZ2sImlDmMIbtDk3KIpeNiS08lQw11NFPTwVFlPP6pJ2gvRfI7gQUfmNAtf6Gs0wQxDsKGlVBdF8rCa3jzdwMaGHOsItrZk7hAyOzpK9VS06j5F49b0VNGOOfKs3lDToMsMBe9ZWtHFEgxTJLs7qrygKZjUnmCYoeAqeU6jqWuLJup4WghOdvCYJnrSkSzoyRkm5M2StQwVltPkfCAk58tET/CSg+8MUecmotMEnhBKfWBIZsg2ihruMJQaoIm+tkTLKEqspMh00w95gvFCQRtDwTT1gVDDSEVdlwqZfxoQRbK0g+tbiBZxzKlpnpypejdDwTaeOvorMk/IJE10h9CqRe28hhLbe0pMsdSwv4ZbhKivo2BjDWfL8UKJgeavwlwb5KlwhyE4u4XkGE2ytZCznKLCDZZq42VzT8HLCrpruFbIfOIINmh/qCdZ1ZBc65kLHR1Bkyf5zn6pN3SvGKIlFNGplhrO9QSXanLOMQTLCa0YJCRrCZm/CZmrLTm7WzCK4GJDiWUdFeYx1LCFg3NMd0XmCuF3Y5rITLDUsYS9zoHVzwnJoYpSTQoObyEzr4cFBNqYTopoaU/wkyLZ2lPhX/5Y95ulxGTV7KjhWrOZgl8MyUUafjYraNjNU1N3IWcjT5WzWqjwtoarHSUObGYO3GCJZpsBlnJGPd6ZYLyl1GdCA2625IwwJDP8GUKymbzuyPlZlvTUsaUh5zFDhRWFzPKKZLAlWdcQbObgF9tOqOsmB1dqcqYJmWstFbZRRI9poolmqiLnU0POvxScpah2iSL5UJNzgScY5+AuIbpO0YD3NCW+dLMszFSdFCWGqG6eVq2uYVNDdICGD6W7EPRWZEY5gpsE9rUkS3mijzzJnm6UpUFXG1hCUeVoS5WfNcFpblELL2qqrCvMvRfd45oalvKU2tiQ6ePJOVMRXase9iTtLJztPxJKLWpo2CRDcJwn2sWSLKIO1WQWNTCvpVUvOZhgSC40JD0dOctaSqzkCRbXsKlb11Oip6PCJ0IwSJM31j3akRxlP7Rwn6aGaUL0qiLnJkvB3xWZ2+Q1TfCwpQH3G0o92UzmX4o/oJNQMMSQc547wVHhdk+VCw01DFYEnTxzZKAm74QmeNNR1w6WzEhNK15VJzuCdxQ53dRUDws5KvwgBMOEgpcVNe0hZI6RXT1Jd0cyj5nsaEAHgVmGaJIlWdsc5Ui2ElrRR6jrRAttNMEAIWrTDFubkZaok7/AkzfIwfuWVq0jHzuCK4QabtLUMVPB3kJ0oyHTSVFlqMALilJf2Rf8k5aaHtMfayocLBS8L89oKoxpJvnAkDPa0qp5DAUTHKWmCcnthlou8iCKaFFLHWcINd1nyIwXqrSxMNmSs6KmoL2QrKuWtlQ5V0120xQ5vRyZS1rgFkWwhiOwiuQbR0OOVhQM9iS3tiXp4RawRPMp5tDletOOBL95MpM01dZTBM9pkn5qF010rIeHFcFZhmSGpYpTsI6nwhqe5C9ynhlpp5ophuRb6WcJFldkVnVEwwxVfrVkvnWUuNLCg5bgboFHPDlDPDmnK7hUrWiIbjadDclujlZcaokOFup4Ri1kacV6jmrrK1hN9bGwpKEBQ4Q6DvIUXOmo6U5LqQM6EPyiKNjVkPnJkDPNEaxhiFay5ExW1NXVUGqcpYYdPcGiCq7z/TSlbhL4pplWXKd7NZO5QQFrefhRQW/NHOsqcIglc4UhWklR8K0QzbAw08CBDnpbgqXdeD/QUsM4RZXDFBW6WJKe/mFPdH0LtBgiq57wFLzlyQzz82qYx5D5WJP5yVJDW01BfyHnS6HKO/reZqId1WGa4Hkh2kWodJ8i6KoIPlAj2hPt76CzXsVR6koPRzWTfKqIentatYpQw2me4AA3y1Kind3SwoOKZDcFXTwl9tWU6mfgRk9d71sKtlNwrjnYw5tC5n5LdKiGry3JKNlHEd3oaMCFHrazBPMp/uNJ+V7IudcSbeOIdjUEdwl0VHCOZo5t6YluEuaC9mQeMgSfOyKnYGFHcIeQ84yQWbuJYJpZw5CzglDH7gKnWqqM9ZTaXcN0TeYhR84eQtJT76JJ1lREe7WnnvsMmRc9FQ7SBBM9mV3lCUdmHk/S2RAMt0QjFNFqQpWjDPQ01DXWUdDBkXziKPjGEP3VP+zIWU2t7im41FOloyWzn/L6dkUy3VLDaZ6appgDLHPjJEsyvJngWEPUyVBiAaHCTEXwrLvSEbV1e1gKJniicWorC1MUrVjB3uDhJE/wgSOzk1DXpk0k73qCM8xw2UvD5kJmDUfOomqMpWCkJRlvKXGmoeBm18USjVIk04SClxTB6YrgLAPLWYK9HLUt5cmc0vYES8GnTeRc6skZbQkWdxRsIcyBRzx1DbTk9FbU0caTPOgJHhJKnOGIVhQqvKmo0llRw9sabrZkDtdg3PqaKi9oatjY8B+G371paMg6+mZFNNtQ04mWBq3rYLOmtWWQp8KJnpy9DdFensyjdqZ+yY40VJlH8wcdLzC8PZnvHMFUTZUrDTkLyQaGus5X5LzpYAf3i+e/ZlhqGqWhh6Ou6xTR9Z6oi5AZZtp7Mj2EEm8oSpxiYZCHU/1fbGdNNNRRoZMhmilEb2gqHOEJDtXkHK/JnG6IrvbPCwV3NhONVdS1thBMs1T4QOBcTWa2IzhMk2nW5Kyn9tXUtpv9RsG2msxk+ZsQzRQacJncpgke0+T8y5Fzj8BiGo7XlJjaTIlpQs7KFjpqGnKuoyEPeIKnFMkZHvopgh81ySxNFWvJWcKRs70j2FOT012IllEEO1n4pD1513Yg2ssQPOThOkvyrqHUdEXOSEsihmBbTbKX1kLBPWqWkLOqJbjB3GBIZmoa8qWl4CG/iZ7oiA72ZL7TJNeZUY7kFQftDcHHluBzRbCegzMtrRjVQpX2lgoPKKLJAkcbMl01XK2p7yhL8pCBbQ3BN2avJgKvttcrWDK3CiUOVxQ8ZP+pqXKyIxnmBymCg5vJjNfkPK4+c8cIfK8ocVt7kmfd/I5SR1hKvCzUtb+lhgc00ZaO6CyhIQP1Uv4yIZjload72PXX0OIJvnFU+0Zf6MhsJwTfW0r0UwQfW4LNLZl5HK261JCZ4qnBaAreVAS3WrjV0LBnNDUNNDToCEeFfwgcb4gOEqLRhirWkexrCEYKVV711DLYEE1XBEsp5tpTGjorkomKYF9FDXv7fR3BGwbettSxnyL53MBPjsxDZjMh+VUW9NRxq1DhVk+FSxQcaGjV9Pawv6eGByw5qzoy7xk4RsOShqjJwWKe/1pEEfzkobeD/dQJmpqedcyBTy2sr4nGNRH0c0SPWTLrqAc0OQcb/gemKgqucQT7ySWKCn2EUotoCvpZct7RO2sy/QW0IWcXd7pQRQyZVwT2USRO87uhjioTLKV2brpMUcMQRbKH/N2T+UlTpaMls6cmc6CCNy3JdYYSUzzJQ4oSD3oKLncULOiJvjBEC2oqnCJkJluCYy2ZQ5so9YYlZ1VLlQU1mXEW1jZERwj/MUSRc24TdexlqLKfQBtDTScJUV8FszXBEY5ktpD5Ur9hYB4Nb1iikw3JoYpkKX+RodRKFt53MMuRnKSpY31PwYaGaILh3wxJGz9TkTPEETxoCWZrgvOlmyMzxFEwVJE5xZKzvyJ4WxEc16Gd4Xe3Weq4XH2jKRikqOkGQ87hQnC7wBmGYLAnesX3M+S87eFATauuN+Qcrh7xIxXJbUIdMw3JGE3ylCWzrieaqCn4zhGM19TQ3z1oH1AX+pWEqIc7wNGAkULBo/ZxRaV9NNyh4Br3rCHZzbzmSfawBL0dNRwpW1kK9mxPXR9povcdrGSZK9c2k0xwFGzjuniCtRSZCZ6ccZ7gaktmgAOtKbG/JnOkJrjcQTdFMsxRQ2cLY3WTIrlCw1eWKn8R6pvt4GFDso3QoL4a3nLk3G6JrtME3dSenpx7PNFTmga0EaJTLQ061sEeQoWXhSo9LTXsaSjoJQRXeZLtDclbCrYzfzHHeaKjHCVOUkQHO3JeEepr56mhiyaYYKjjNU+Fed1wS5VlhWSqI/hYUdDOkaxiKehoyOnrCV5yBHtbWFqTHCCwtpDcYolesVR5yUzTZBb3RNMd0d6WP+SvhuBmRcGxnuQzT95IC285cr41cLGQ6aJJhmi4TMGempxeimBRQw1tFKV+8jd6KuzoSTqqDxzRtpZkurvKEHxlqXKRIjjfUNNXQsNOsRScoWFLT+YeRZVD3GRN0MdQcKqQjHDMrdGGVu3iYJpQx3WGUvfbmxwFfR20WBq0oYY7LMFhhgYtr8jpaEnaOzjawWWaTP8mMr0t/EPDPoqcnxTBI5o58L7uoWnMrpoqPwgVrlAUWE+V+TQl9rawoyP6QGAlQw2TPRX+YSkxyBC8Z6jhHkXBgQL7WII3DVFnRfCrBfxewv9D6xsyjys4VkhWb9pUU627JllV0YDNHMku/ldNMMXDEo4aFnAkk4U6frNEU4XgZUPmEKHUl44KrzmYamjAbh0JFvGnaTLPu1s9jPCwjFpYiN7z1DTOk/nc07CfDFzmCf7i+bfNHXhDtLeBXzTBT5rkMvWOIxpl4EMh2LGJBu2syDnAEx2naEhHDWMMzPZEhygyS1mS5RTJr5ZkoKbEUoYqr2kqdDUE8ztK7OaIntJkFrIECwv8LJTaVx5XJE86go8dFeZ3FN3rjabCAYpoYEeC9zzJVULBbmZhDyd7ko09ydpNZ3nm2Kee4FPPXHnYEF1nqOFEC08LUVcDvYXkJHW8gTaKCk9YGOeIJhqiE4ToPEepdp7IWFjdwnWaufGMwJJCMtUTTBBK9BGCOy2tGGrJTHIwyEOzp6aPzNMOtlZkDvcEWpP5SVNhfkvDxhmSazTJXYrM9U1E0xwFVwqZQwzJxw6+kGGGUj2FglGGmnb1/G51udRSMNlTw6GGnCcUwVcOpmsqTHa06o72sw1RL02p9z0VbnMLOaIX3QKaYKSCFQzBKEUNHTSc48k53RH9wxGMtpQa5KjjW0W0n6XCCCG4yxNNdhQ4R4l1Ff+2sSd6UFHiIEOyqqFgT01mEUMD+joy75jPhOA+oVVLm309FR4yVOlp4RhLiScNmSmaYF5Pw0STrOIoWMSR2UkRXOMp+M4SHW8o8Zoi6OZgjKOaFar8zZDzkWzvKOjkKBjmCXby8JahhjXULY4KlzgKLvAwxVGhvyd4zxB1d9T0piazmKLCVZY5sKiD0y2ZSYrkUEPUbIk+dlQ4SJHTR50k1DPaUWIdTZW9NJwnJMOECgd7ou/MnppMJ02O1VT4Wsh85MnZzcFTngpXGKo84qmwgKbCL/orR/SzJ2crA+t6Mp94KvxJUeIbT3CQu1uIdlQEOzlKfS3UMcrTiFmOuroocrZrT2AcmamOKg8YomeEKm/rlT2sociMaybaUlFhuqHCM2qIJ+rg4EcDFymiDSxzaHdPcpE62pD5kyM5SBMoA1PaUtfIthS85ig1VPiPPYXgYEMNk4Qq7TXBgo7oT57gPUdwgCHzhIVFPFU6OYJzHAX9m5oNrVjeE61miDrqQ4VSa1oiURTsKHC0IfjNwU2WzK6eqK8jWln4g15TVBnqmDteCJ501PGAocJhhqjZdtBEB6lnhLreFJKxmlKbeGrqLiSThVIbCdGzloasa6lpMQXHCME2boLpJgT7yWaemu6wBONbqGNVRS0PKIL7LckbjmQtR7K8I5qtqel+T/ChJTNIKLjdUMNIRyvOEko9YYl2cwQveBikCNawJKcLBbc7+JM92mysNvd/Fqp8a0k6CNEe7cnZrxlW0wQXaXjaktnRwNOGZKYiONwS7a1JVheq3WgJHlQUGKHKmp4KAxXR/ULURcNgoa4zhKSLpZR3kxRRb0NmD0OFn+UCS7CzI1nbP6+o4x47QZE5xRCt3ZagnYcvmpYQktXdk5YKXTzBC57kKEe0VVuiSYqapssMS3C9p2CKkHOg8B8Pa8p5atrIw3qezIWanMGa5HRDNF6RM9wcacl0N+Q8Z8hsIkSnaIIdHRUOEebAPy1zbCkhM062FCJtif7PU+UtoVXzWKqM1PxXO8cfdruhFQ/a6x3JKYagvVDhQEtNiyiiSQ7OsuRsZUku0CRNDs4Sog6KKjsZgk2bYJqijgsEenoKeniinRXBn/U3lgpPdyDZynQx8IiioMnCep5Ky8mjGs6Wty0l1hUQTcNWswS3WRp2kCNZwJG8omG8JphPUaFbC8lEfabwP7VtM9yoaNCAjpR41VNhrD9LkbN722v0CoZMByFzhaW+MyzRYEWFDQwN2M4/JiT76PuljT3VU/A36eaIThb+R9oZGOAJ9tewkgGvqOMNRWYjT/Cwu99Q8LqDE4TgbLWxJ1jaDDAERsFOFrobgjUsBScaguXU8kKm2RL19tRypSHnHNlHiIZqgufs4opgQdVdwxBNNFBR6kVFqb8ogimOzB6a6HTzrlDHEpYaxjiiA4TMQobkDg2vejjfwJGWmnbVFAw3H3hq2NyQfG7hz4aC+w3BbwbesG0swYayvpAs6++Ri1Vfzx93mFChvyN5xVHTS+0p9aqCAxyZ6ZacZyw5+7uuQkFPR9DDk9NOiE7X1PCYJVjVUqq7JlrHwWALF5nfHNGjApdpqgzx5OwilDhCiDYTgnc9waGW4BdLNNUQvOtpzDOWHDH8D7TR/A/85KljEQu3NREc4Pl/6B1Hhc8Umb5CsKMmGC9EPcxoT2amwHNCmeOEnOPbklnMkbOgIvO5UMOpQrS9UGVdt6iH/fURjhI/WOpaW9OKLYRod6HCUEdOX000wpDZQ6hwg6LgZfOqo1RfT/CrJzjekXOGhpc1VW71ZLbXyyp+93ILbC1kPtIEYx0FIx1VDrLoVzXRKRYWk809yYlC9ImcrinxtabKnzRJk3lAU1OLEN1j2zrYzr2myHRXJFf4h4QKT1qSTzTB5+ZNTzTRkAxX8FcLV2uS8eoQQ2aAkFzvCM72sJIcJET3WPjRk5wi32uSS9rfZajpWEvj9hW42F4o5NytSXYy8IKHay10VYdrcl4SkqscrXpMwyGOgtkajheSxdQqmpxP1L3t4R5PqasFnrQEjytq6qgp9Y09Qx9o4S1FzhUCn1kyHSzBWLemoSGvOqLNhZyBjmCaAUYpMgt4Ck7wBBMMwWKWgjsUwTaGVsxWC1mYoKiyqqeGKYqonSIRQ3KIkHO0pmAxTdBHkbOvfllfr+AA+7gnc50huVKYK393FOyg7rbPO/izI7hE4CnHHHnJ0ogNPRUGeUpsrZZTBJcrovUcJe51BPsr6GkJdhCCsZ6aTtMEb2pqWkqeVtDXE/QVggsU/Nl86d9RMF3DxvZTA58agu810RWawCiSzzXBeU3MMW9oyJUedvNEvQyNu1f10BSMddR1vaLCYpYa/mGocLSiYDcLbQz8aMn5iyF4xBNMs1P0QEOV7o5gaWGuzSeLue4tt3ro7y4Tgm4G/mopdZgl6q0o6KzJWE3mMksNr3r+a6CbT8g5wZNzT9O7fi/zpaOmnz3BRoqos+tv9zMbdpxsqDBOEewtJLt7cg5wtKKbvldpSzRRCD43VFheCI7yZLppggMVBS/KMAdHODJvOwq2NQSbKKKPLdFWQs7Fqo+mpl01JXYRgq8dnGLhTiFzqmWsUMdpllZdbKlyvSdYxhI9YghOtxR8LgSLWHK62mGGVoxzBE8LNWzqH9CUesQzFy5RQzTc56mhi6fgXEWwpKfE5Z7M05ZgZUPmo6auiv8YKzDYwWBLMErIbKHJvOwIrvEdhOBcQ9JdU1NHQ7CXn2XIDFBKU2WAgcX9UAUzDXWd5alwuyJ41Z9rjKLCL4aCp4WarhPm2rH+SaHUYE001JDZ2ZAzXPjdMpZWvC9wmqIB2lLhQ01D5jO06hghWMndbM7yRJMsoCj1vYbnFQVrW9jak3OlEJ3s/96+p33dEPRV5GxiqaGjIthUU6FFEZyqCa5qJrpBdzSw95IUnOPIrCUUjRZQFrbw5PR0R1qiYx3cb6nrWUMrBmmiBQxVHtTew5ICP/ip6g4hed/Akob/32wvBHsIOX83cI8hGeNeNPCIkPmXe8fPKx84OMSRM1MTdXSwjCZ4S30jVGhvqTRak/OVhgGazHuOCud5onEO1lJr6ecVyaOK6H7zqlBlIaHE0oroCgfvGJIdPcmfLNGLjpz7hZwZQpUbFME0A1cIJa7VNORkgfsMBatbKgwwJM9bSvQXeNOvbIjelg6WWvo5kvbKaJJNHexkKNHL9xRyFlH8Ti2riB5wVPhUk7nGkJnoCe428LR/wRGdYIlmWebCyxou1rCk4g/ShugBDX0V0ZQWkh0dOVsagkM0yV6OoLd5ye+pRlsCr0n+KiQrGuq5yJDzrTAXHtLUMduTDBVKrSm3eHL+6ijxhFDX9Z5gVU/wliHYTMiMFpKLNMEywu80wd3meoFmt6VbRMPenhrOc6DVe4pgXU8DnnHakLOIIrlF4FZPIw6R+zxBP0dyq6OOZ4Q5sLKCcz084ok+VsMMyQhNZmmBgX5xIXOEJTmi7VsGTvMTNdHHhpzdbE8Du2oKxgvBqQKdDDnTFOylCFaxR1syz2iqrOI/FEpNc3C6f11/7+ASS6l2inq2ciTrCCzgyemrCL5SVPjQkdPZUmGy2c9Sw9FtR1sS30RmsKPCS4rkIC/2U0MduwucYolGaPjKEyhzmiPYXagyWbYz8LWBDdzRimAXzxx4z8K9hpzlhLq+NiQ97HuKorMUfK/OVvC2JfiHUPCQI/q7J2gjK+tTDNxkCc4TMssqCs4TGtLVwQihyoAWgj9bosU80XGW6Ac9TJGziaUh5+hnFcHOnlaM1iRn29NaqGENTTTSUHCH2tWTeV0osUhH6psuVLjRUmGWhm6OZEshGeNowABHcJ2Bpy2ZszRcKkRXd2QuKVEeXnbfaEq825FguqfgfE2whlChSRMdron+LATTPQ2Z369t4B9C5gs/ylzv+CMmepIDPclFQl13W0rspPd1JOcbghGOEutqCv5qacURQl3dDKyvyJlqKXGPgcM9FfawJAMVmdcspcYKOZc4GjDYkFlK05olNMHyHn4zFNykyOxt99RkHlfwmiHo60l2EKI+mhreEKp080Tbug08BVPcgoqC5zWt+NLDTZ7oNSF51N1qie7Va3uCCwyZbkINf/NED6jzOsBdZjFN8oqG3wxVunqCSYYKf3EdhJyf9YWGf7tRU2oH3VHgPr1fe5J9hOgHd7xQ0y7qBwXr23aGErP0cm64JVjZwsOGqL+mhNgZmhJLW2oY4UhedsyBgzrCKrq7BmcpNVhR6jBPq64Vgi+kn6XE68pp8J5/+0wRHGOpsKenQn9DZntPzjRLZpDAdD2fnSgkG9tmIXnUwQ6WVighs7Yi2MxQ0N3CqYaCXkJ0oyOztMDJjmSSpcpvlrk0RMMOjmArQ04PRV1DO1FwhCVaUVPpKUM03JK5SxPsIWRu8/CGHi8UHChiqGFDTbSRJWeYUDDcH6vJWUxR4k1FXbMUwV6e4AJFXS8oMqsZKqzvYQ9DDQdZckY4aGsIhtlubbd2r3j4QBMoTamdPZk7O/Bf62lacZwneNjQoGcdVU7zJOd7ghsUHOkosagic6cnWc8+4gg285R6zZP5s1/LUbCKIznTwK36PkdwlOrl4U1LwfdCCa+IrvFkmgw1PCAUXKWo0sURXWcI2muKJlgyFzhynCY4RBOsqCjoI1R5zREco0n2Vt09BQtYSizgKNHfUmUrQ5UOCh51BFcLmY7umhYqXKQomOop8bUnWNNQcIiBcYaC6xzMNOS8JQQfeqKBmmglB+97ok/lfk3ygaHSyZaCRTzRxQo6GzLfa2jWBPepw+UmT7SQEJyiyRkhBLMVOfcoMjcK0eZChfUNzFAUzCsEN5vP/X1uP/n/aoMX+K+nw/Hjr/9xOo7j7Pju61tLcgvJpTWXNbfN5jLpi6VfCOviTktKlFusQixdEKWmEBUKNaIpjZRSSOXSgzaaKLdabrm1/9nZ+/f+vd/vz/v9+Xy+zZ7PRorYoZqyLrCwQdEAixxVOEXNNnjX2nUSRlkqGmWowk8lxR50JPy9Bo6qJXaXwNvREBvnThPEPrewryLhcAnj5WE15Fqi8W7R1sAuEu86S4ENikItFN4xkv9Af4nXSnUVcLiA9xzesFpivRRVeFKtsMRaKBhuSbjOELnAUtlSQUpXgdfB4Z1oSbnFEetbQ0IrAe+Y+pqnDcEJFj6S8LDZzZHwY4e3XONNlARraomNEt2bkvGsosA3ioyHm+6jCMbI59wqt4eeara28IzEmyPgoRaUOEDhTVdEJhmCoTWfC0p8aNkCp0oYqih2iqGi4yXeMkOsn4LdLLnmKfh/YogjNsPebeFGR4m9BJHLzB61XQ3BtpISfS2FugsK9FAtLWX1dCRcrCnUp44CNzuCowUZmxSRgYaE6Za0W2u/E7CVXCiI/UOR8aAm1+OSyE3mOUcwyc1zBBeoX1kiKy0Zfxck1Gsyulti11i83QTBF5Kg3pDQThFMVHiPSlK+0cSedng/VaS8bOZbtsBcTcZAR8JP5KeqQ1OYKAi20njdNNRpgnsU//K+JnaXJaGTomr7aYIphoRn9aeShJWKEq9LcozSF7QleEfDI5LYm5bgVkFkRwVDBCVu0DDIkGupo8TZBq+/pMQURYErJQmPKGKjNDkWOLx7Jd5QizdUweIaKrlP7SwJDhZvONjLkOsBBX9UpGxnydhXkfBLQ8IxgojQbLFnJf81JytSljclYYyEFyx0kVBvKWOFJmONpshGAcsduQY5giVNCV51eOdJYo/pLhbvM0uDHSevNKRcrKZIqnCtJeEsO95RoqcgGK4ocZcho1tTYtcZvH41pNQ7vA0WrhIfOSraIIntIAi+NXWCErdbkvrWwjRLrt0NKUdL6KSOscTOdMSOUtBHwL6OLA0vNSdynaWQEnCpIvKaIrJJEbvHkmuNhn6OjM8VkSGSqn1uYJCGHnq9I3aLhNME3t6GjIkO7xrNFumpyTNX/NrwX7CrIRiqqWijI9JO4d1iieykyfiposQIQ8YjjsjlBh6oHWbwRjgYJQn2NgSnNycmJAk3NiXhx44Sxykihxm8ybUwT1OVKySc7vi3OXVkdBJ4AyXBeksDXG0IhgtYY0lY5ahCD0ehborIk5aUWRJviMA7Xt5kyRjonrXENkm8yYqgs8VzgrJmClK20uMM3jRJ0FiQICQF9hdETlLQWRIb5ki6WDfWRPobvO6a4GP5mcOrNzDFELtTkONLh9dXE8xypEg7z8A9jkhrQ6Fhjlg/QVktJXxt4WXzT/03Q8IaQWSqIuEvloQ2mqC9Jfi7wRul4RX3pSPlzpoVlmCtI2jvKHCFhjcM3sN6lqF6HxnKelLjXWbwrpR4xzuCrTUZx2qq9oAh8p6ixCUGr78g8oyjRAtB5CZFwi80VerVpI0h+IeBxa6Zg6kWvpDHaioYYuEsRbDC3eOmC2JvGYLeioxGknL2UATNJN6hmtj1DlpLvDVmocYbrGCVJKOrg4X6DgddLA203BKMFngdJJFtFd7vJLm6KEpc5yjQrkk7M80SGe34X24nSex1Ra5Omgb71JKyg8SrU3i/kARKwWpH0kOGhKkObyfd0ZGjvyXlAkVZ4xRbYJ2irFMkFY1SwyWxr2oo4zlNiV+7zmaweFpT4kR3kaDAFW6xpSqzJay05FtYR4HmZhc9UxKbbfF2V8RG1MBmSaE+kmC6JnaRXK9gsiXhJHl/U0qM0WTcbyhwkYIvFGwjSbjfwhiJt8ZSQU+Bd5+marPMOkVkD0muxYLIfEuhh60x/J92itguihJSEMySVPQnTewnEm+620rTQEMsOfo4/kP/0ARvWjitlpSX7GxBgcMEsd3EEeYWvdytd+Saawi6aCIj1CkGb6Aj9rwhx16Cf3vAwFy5pyLhVonXzy51FDpdEblbkdJbUcEPDEFzQ8qNmhzzLTmmKWKbFCXeEuRabp6rxbvAtLF442QjQ+wEA9eL1xSR7Q0JXzlSHjJ4exq89yR0laScJ/FW6z4a73pFMEfDiRZvuvijIt86RaSFOl01riV2mD1UEvxGk/Geg5aWwGki1zgKPG9J2U8PEg8qYvMsZeytiTRXBMslCU8JSlxi8EabjwUldlDNLfzTUmCgxWsjqWCOHavYAqsknKFIO0yQ61VL5AVFxk6WhEaCAkdJgt9aSkzXlKNX2jEa79waYuc7gq0N3GDJGCBhoiTXUEPsdknCUE1CK0fwsiaylSF2uiDyO4XX3pFhNd7R4itFGc0k/ElBZwWvq+GC6szVeEoS/MZ+qylwpKNKv9Z469UOjqCjwlusicyTxG6VpNxcQ8IncoR4RhLbR+NdpGGmJWOcIzJGUuKPGpQg8rrG21dOMqQssJQ4RxH5jaUqnZuQ0F4Q+cjxLwPtpZbIAk3QTJHQWBE5S1BokoVtDd6lhqr9UpHSUxMcIYl9pojsb8h4SBOsMQcqvOWC2E8EVehqiJ1hrrAEbQxeK0NGZ0Gkq+guSRgniM23bIHVkqwx4hiHd7smaOyglyIyQuM978j4VS08J/A2G1KeMBRo4fBaSNhKUEZfQewVQ/C1I+MgfbEleEzCUw7mKXI0M3hd1EESVji8x5uQ41nxs1q4RMJCCXs7Iq9acpxn22oSDnQ/sJTxsCbHIYZiLyhY05TY0ZLIOQrGaSJDDN4t8pVaIrsqqFdEegtizc1iTew5Q4ayBDMUsQMkXocaYkc0hZua412siZ1rSXlR460zRJ5SlHGe5j801RLMlJTxtaOM3Q1pvxJ45zUlWFD7rsAbpfEm1JHxG0eh8w2R7QQVzBUw28FhFp5QZzq8t2rx2joqulYTWSuJdTYfWwqMFMcovFmSyJPNyLhE4E10pHzYjOC3huArRa571ZsGajQpQx38SBP5pyZB6lMU3khDnp0MBV51BE9o2E+TY5Ml2E8S7C0o6w1xvCZjf0HkVEHCzFoyNmqC+9wdcqN+Tp7jSDheE9ws8Y5V0NJCn2bk2tqSY4okdrEhx1iDN8cSudwepWmAGXKcJXK65H9to8jYQRH7SBF01ESUJdd0TayVInaWhLkOjlXE5irKGOnI6GSWGCJa482zBI9rCr0jyTVcEuzriC1vcr6mwFGSiqy5zMwxBH/TJHwjSPhL8+01kaaSUuMFKTcLEvaUePcrSmwn8DZrgikWb7CGPxkSjhQwrRk57tctmxLsb9sZvL9LSlyuSLlWkqOjwduo8b6Uv1DkmudIeFF2dHCgxVtk8dpIvHpBxhEOdhKk7OLIUSdJ+cSRY57B+0DgGUUlNfpthTfGkauzxrvTsUUaCVhlKeteTXCoJDCa2NOKhOmC4G1H8JBd4OBZReSRGkqcb/CO1PyLJTLB4j1q8JYaIutEjSLX8YKM+a6phdMsdLFUoV5RTm9JSkuDN8WcIon0NZMNZWh1q8C7SJEwV5HxrmnnTrf3KoJBlmCYI2ilSLlfEvlE4011NNgjgthzEua0oKK7JLE7HZHlEl60BLMVFewg4EWNt0ThrVNEVkkiTwpKXSWJzdRENgvKGq4IhjsiezgSFtsfCUq8qki5S1LRQeYQQ4nemmCkImWMw3tFUoUBZk4NOeZYEp4XRKTGa6wJjrWNHBVJR4m3FCnbuD6aak2WsMTh3SZImGCIPKNgsDpVwnsa70K31lCFJZYcwwSMFcQulGTsZuEaSdBXkPGZhu0FsdUO73RHjq8MPGGIfaGIbVTk6iuI3GFgucHrIQkmWSJdBd7BBu+uOryWAhY7+Lki9rK5wtEQzWwvtbqGhIMFwWRJsElsY4m9IIg9L6lCX0VklaPAYkfkZEGDnOWowlBJjtMUkcGK4Lg6EtoZInMUBVYLgn0UsdmCyCz7gIGHFfk+k1QwTh5We7A9x+IdJ6CvIkEagms0hR50eH9UnTQJ+2oiKyVlLFUE+8gBGu8MQ3CppUHesnjTHN4QB/UGPhCTHLFPHMFrCqa73gqObUJGa03wgbhHkrCfpEpzNLE7JDS25FMKhlhKKWKfCgqstLCPu1zBXy0J2ztwjtixBu8UTRn9LVtkmCN2iyFhtME70JHRQ1KVZXqKI/KNIKYMCYs1GUMEKbM1bKOI9LDXC7zbHS+bt+1MTWS9odA9DtrYtpbImQJ2VHh/lisEwaHqUk1kjKTAKknkBEXkbkdMGwq0dnhzLJF3NJH3JVwrqOB4Sca2hti75nmJN0WzxS6UxDYoEpxpa4htVlRjkYE7DZGzJVU72uC9IyhQL4i8YfGWSYLLNcHXloyz7QhNifmKSE9JgfGmuyLhc403Xm9vqcp6gXe3xuuv8F6VJNxkyTHEkHG2g0aKXL0MsXc1bGfgas2//dCONXiNLCX+5mB7eZIl1kHh7ajwpikyzlUUWOVOsjSQlsS+M0R+pPje/dzBXRZGO0rMtgQrLLG9VSu9n6CMXS3BhwYmSoIBhsjNBmZbgusE9BCPCP5triU4VhNbJfE+swSP27aayE8tuTpYYjtrYjMVGZdp2NpS1s6aBnKSHDsbKuplKbHM4a0wMFd/5/DmGyKrJSUaW4IBrqUhx0vyfzTBBLPIUcnZdrAkNsKR0sWRspumSns6Ch0v/qqIbBYUWKvPU/CFoyrDJGwSNFhbA/MlzKqjrO80hRbpKx0Jewsi/STftwGSlKc1JZyAzx05dhLEdnfQvhZOqiHWWEAHC7+30FuRcZUgaO5gpaIK+xsiHRUsqaPElTV40xQZQ107Q9BZE1nryDVGU9ZSQ47bmhBpLcYpUt7S+xuK/FiT8qKjwXYw5ypS2iuCv7q1gtgjhuBuB8LCFY5cUuCNtsQOFcT+4Ih9JX+k8Ea6v0iCIRZOtCT0Et00JW5UeC85Cg0ScK0k411HcG1zKtre3SeITBRk7WfwDhEvaYLTHP9le0m8By0JDwn4TlLW/aJOvGHxdjYUes+ScZigCkYQdNdEOhkiezgShqkx8ueKjI8lDfK2oNiOFvrZH1hS+tk7NV7nOmLHicGWEgubkXKdwdtZknCLJXaCpkrjZBtLZFsDP9CdxWsSr05Sxl6CMmoFbCOgryX40uDtamB7SVmXW4Ihlgpmq+00tBKUUa83WbjLUNkzDmY7cow1JDygyPGlhgGKYKz4vcV7QBNbJIgM11TUqZaMdwTeSguH6rOaw1JRKzaaGyxVm2EJ/uCIrVWUcZUkcp2grMsEjK+DMwS59jQk3Kd6SEq1d0S6uVmO4Bc1lDXTUcHjluCXEq+1OlBDj1pi9zgiXxnKuE0SqTXwhqbETW6RggMEnGl/q49UT2iCzgJvRwVXS2K/d6+ZkyUl7jawSVLit46EwxVljDZwoSQ20sDBihztHfk2yA8NVZghiXwrYHQdfKAOtzsayjhY9bY0yE2CWEeJ9xfzO423xhL5syS2TFJofO2pboHob0nY4GiAgRrvGQEDa/FWSsoaaYl0syRsEt3kWoH3B01shCXhTUWe9w3Bt44SC9QCh3eShQctwbaK2ApLroGCMlZrYqvlY3qYhM0aXpFkPOuoqJ3Dm6fxXrGwVF9gCWZagjPqznfkuMKQ8DPTQRO8ZqG1hPGKEm9IgpGW4DZDgTNriTxvFiq+Lz+0cKfp4wj6OCK9JSnzNSn9LFU7UhKZZMnYwcJ8s8yRsECScK4j5UOB95HFO0CzhY4xJxuCix0lDlEUeMdS6EZBkTsUkZ4K74dugyTXS7aNgL8aqjDfkCE0ZbwkCXpaWCKhl8P7VD5jxykivSyxyZrYERbe168LYu9ZYh86IkscgVLE7tWPKmJv11CgoyJltMEbrohtVAQfO4ImltiHEroYEs7RxAarVpY8AwXMcMReFOTYWe5iiLRQxJ5Q8DtJ8LQhWOhIeFESPGsILhbNDRljNbHzNRlTFbk2S3L0NOS6V1KFJYKUbSTcIIhM0wQ/s2TM0SRMNcQmSap3jCH4yhJZKSkwyRHpYYgsFeQ4U7xoCB7VVOExhXepo9ABBsYbvGWKXPME3lyH95YioZ0gssQRWWbI+FaSMkXijZXwgiTlYdPdkNLaETxlyDVIwqeaEus0aTcYcg0RVOkpR3CSJqIddK+90JCxzsDVloyrFd5ZAr4TBKfaWa6boEA7C7s6EpYaeFPjveooY72mjIccLHJ9HUwVlDhKkmutJDJBwnp1rvulJZggKDRfbXAkvC/4l3ozQOG9a8lxjx0i7nV4jSXc7vhe3OwIxjgSHjdEhhsif9YkPGlus3iLFDnWOFhtCZbJg0UbQcIaR67JjthoCyMEZRwhiXWyxO5QxI6w5NhT4U1WsJvDO60J34fW9hwzwlKij6ZAW9ne4L0s8C6XeBMEkd/LQy1VucBRot6QMlbivaBhoBgjqGiCJNhsqVp/S2SsG6DIONCR0dXhvWbJ+MRRZJkkuEjgDXJjFQW6SSL7GXK8Z2CZg7cVsbWGoKmEpzQ5elpiy8Ryg7dMkLLUEauzeO86CuwlSOlgYLojZWeJ9xM3S1PWfEfKl5ISLQ0MEKR8YOB2QfCxJBjrKPCN4f9MkaSsqoVXJBmP7EpFZ9UQfOoOFwSzBN4MQ8LsGrymlipcJQhmy0GaQjPqCHaXRwuCZwRbqK2Fg9wlClZqYicrIgMdZfxTQ0c7TBIbrChxmuzoKG8XRaSrIhhiyNFJkrC7oIAWMEOQa5aBekPCRknCo4IKPrYkvCDI8aYmY7WFtprgekcJZ3oLIqssCSMtFbQTJKwXYy3BY5oCh2iKPCpJOE+zRdpYgi6O2KmOAgvVCYaU4ySRek1sgyFhJ403QFHiVEmJHwtybO1gs8Hr5+BETQX3War0qZngYGgtVZtoqd6vFSk/UwdZElYqyjrF4HXUeFspIi9IGKf4j92pKGAdCYMVsbcV3kRF0N+R8LUd5PCsIGWoxDtBkCI0nKofdJQxT+LtZflvuc8Q3CjwWkq8KwUpHzkK/NmSsclCL0nseQdj5FRH5CNHSgtLiW80Of5HU9Hhlsga9bnBq3fEVltKfO5IaSTmGjjc4J0otcP7QsJUSQM8pEj5/wCuUuC2DWz8AAAAAElFTkSuQmCC"); +} diff --git a/MixERP.Net.FrontEnd/Scripts/CodeMirror/theme/twilight.css b/MixERP.Net.FrontEnd/Scripts/CodeMirror/theme/twilight.css new file mode 100644 index 000000000..fd8944ba8 --- /dev/null +++ b/MixERP.Net.FrontEnd/Scripts/CodeMirror/theme/twilight.css @@ -0,0 +1,26 @@ +.cm-s-twilight.CodeMirror { background: #141414; color: #f7f7f7; } /**/ +.cm-s-twilight .CodeMirror-selected { background: #323232 !important; } /**/ + +.cm-s-twilight .CodeMirror-gutters { background: #222; border-right: 1px solid #aaa; } +.cm-s-twilight .CodeMirror-linenumber { color: #aaa; } +.cm-s-twilight .CodeMirror-cursor { border-left: 1px solid white !important; } + +.cm-s-twilight .cm-keyword { color: #f9ee98; } /**/ +.cm-s-twilight .cm-atom { color: #FC0; } +.cm-s-twilight .cm-number { color: #ca7841; } /**/ +.cm-s-twilight .cm-def { color: #8DA6CE; } +.cm-s-twilight span.cm-variable-2, .cm-s-twilight span.cm-tag { color: #607392; } /**/ +.cm-s-twilight span.cm-variable-3, .cm-s-twilight span.cm-def { color: #607392; } /**/ +.cm-s-twilight .cm-operator { color: #cda869; } /**/ +.cm-s-twilight .cm-comment { color:#777; font-style:italic; font-weight:normal; } /**/ +.cm-s-twilight .cm-string { color:#8f9d6a; font-style:italic; } /**/ +.cm-s-twilight .cm-string-2 { color:#bd6b18 } /*?*/ +.cm-s-twilight .cm-meta { background-color:#141414; color:#f7f7f7; } /*?*/ +.cm-s-twilight .cm-error { border-bottom: 1px solid red; } +.cm-s-twilight .cm-builtin { color: #cda869; } /*?*/ +.cm-s-twilight .cm-tag { color: #997643; } /**/ +.cm-s-twilight .cm-attribute { color: #d6bb6d; } /*?*/ +.cm-s-twilight .cm-header { color: #FF6400; } +.cm-s-twilight .cm-hr { color: #AEAEAE; } +.cm-s-twilight .cm-link { color:#ad9361; font-style:italic; text-decoration:none; } /**/ + diff --git a/MixERP.Net.FrontEnd/Scripts/CodeMirror/theme/vibrant-ink.css b/MixERP.Net.FrontEnd/Scripts/CodeMirror/theme/vibrant-ink.css new file mode 100644 index 000000000..22024a489 --- /dev/null +++ b/MixERP.Net.FrontEnd/Scripts/CodeMirror/theme/vibrant-ink.css @@ -0,0 +1,27 @@ +/* Taken from the popular Visual Studio Vibrant Ink Schema */ + +.cm-s-vibrant-ink.CodeMirror { background: black; color: white; } +.cm-s-vibrant-ink .CodeMirror-selected { background: #35493c !important; } + +.cm-s-vibrant-ink .CodeMirror-gutters { background: #002240; border-right: 1px solid #aaa; } +.cm-s-vibrant-ink .CodeMirror-linenumber { color: #d0d0d0; } +.cm-s-vibrant-ink .CodeMirror-cursor { border-left: 1px solid white !important; } + +.cm-s-vibrant-ink .cm-keyword { color: #CC7832; } +.cm-s-vibrant-ink .cm-atom { color: #FC0; } +.cm-s-vibrant-ink .cm-number { color: #FFEE98; } +.cm-s-vibrant-ink .cm-def { color: #8DA6CE; } +.cm-s-vibrant-ink span.cm-variable-2, .cm-s-cobalt span.cm-tag { color: #FFC66D } +.cm-s-vibrant-ink span.cm-variable-3, .cm-s-cobalt span.cm-def { color: #FFC66D } +.cm-s-vibrant-ink .cm-operator { color: #888; } +.cm-s-vibrant-ink .cm-comment { color: gray; font-weight: bold; } +.cm-s-vibrant-ink .cm-string { color: #A5C25C } +.cm-s-vibrant-ink .cm-string-2 { color: red } +.cm-s-vibrant-ink .cm-meta { color: #D8FA3C; } +.cm-s-vibrant-ink .cm-error { border-bottom: 1px solid red; } +.cm-s-vibrant-ink .cm-builtin { color: #8DA6CE; } +.cm-s-vibrant-ink .cm-tag { color: #8DA6CE; } +.cm-s-vibrant-ink .cm-attribute { color: #8DA6CE; } +.cm-s-vibrant-ink .cm-header { color: #FF6400; } +.cm-s-vibrant-ink .cm-hr { color: #AEAEAE; } +.cm-s-vibrant-ink .cm-link { color: blue; } diff --git a/MixERP.Net.FrontEnd/Scripts/CodeMirror/theme/visual-studio-ex.css b/MixERP.Net.FrontEnd/Scripts/CodeMirror/theme/visual-studio-ex.css new file mode 100644 index 000000000..1b1de3eea --- /dev/null +++ b/MixERP.Net.FrontEnd/Scripts/CodeMirror/theme/visual-studio-ex.css @@ -0,0 +1,113 @@ +body.visual-studio-ex #sidebar{ + background:#f6f6f6; + text-shadow:none; +} + +body.visual-studio-ex #working-set-header, +body.visual-studio-ex #open-files-container{ /* Working files */ + background:#f0f0f0; +} + +body.visual-studio-ex #project-files-header, +body.visual-studio-ex #working-set-header{/* "working files" header and folder header*/ + color:#777!important; +} + +body.visual-studio-ex #project-dropdown-toggle:hover{ /* Open url when hover */ + color:#555!important; + background:#e8e8e8; +} + +body.visual-studio-ex .jstree-brackets li a, +body.visual-studio-ex .jstree-brackets li .extension, +body.visual-studio-ex .jstree-brackets li a.jstree-clicked, /* Files, folder and extensions */ +body.visual-studio-ex #open-files-container li a, +body.visual-studio-ex #open-files-container li .extension, +body.visual-studio-ex #open-files-container li a.jstree-clicked{ /* Files, folder and extensions in "working fiels"*/ + color:#222!important; +} + +body.visual-studio-ex .sidebar-selection{ /* Selected file or folder */ + background:#cccedb; +} + +body.visual-studio-ex .sidebar-selection-triangle{ /* ^ the cool arrow */ + background:transparent; +} + +body.visual-studio-ex .sidebar-selection-triangle.triangle-visible::before{ + border-left:12px solid #cccedb; +} + +body.visual-studio-ex #main-toolbar{ /* Toolbar to the right */ + background:#f6f6f6; +} + +body.visual-studio-ex #status-bar{ /* Bottom status bar */ + background:#f6f6f6; + border-top:1px solid #d4d4d4; +} + +body.visual-studio-ex #status-indicators, +body.visual-studio-ex #status-info{ /* Status bar text */ + background:transparent; +} + +body.visual-studio-ex .CodeMirror-scroll{ + background-color: #fefefe; + color:black; +} + +body.visual-studio-ex .CodeMirror .CodeMirror-lines pre{ + z-index: 3; +} + +body.visual-studio-ex .CodeMirror .CodeMirror-gutters{ + background-color: #fefefe; +} + +body.visual-studio-ex .CodeMirror .CodeMirror-linenumber{ + color: #0E97A1; + background-color: #fefefe; +} + +body.visual-studio-ex .CodeMirror .CodeMirror-matchingbracket{ + color: black; + background-color: #dedede; +} + +body.visual-studio-ex .CodeMirror .CodeMirror-linebackground{ + outline: 2px solid #dddddd; + z-index: 3; +} + + +body.visual-studio-ex .CodeMirror span.cm-atom { color: blue; } +body.visual-studio-ex .CodeMirror span.cm-qualifier, .CodeMirror span.cm-builtin { color: #800000; } + +body.visual-studio-ex .CodeMirror span.cm-keyword { color: blue; } +body.visual-studio-ex .CodeMirror span.cm-comment { color: green; } +body.visual-studio-ex .CodeMirror span.cm-string {color: #800000;} +body.visual-studio-ex .CodeMirror span.cm-string-2 {color: #800000;} +body.visual-studio-ex .CodeMirror span.cm-variable { color: black; } +body.visual-studio-ex .CodeMirror span.cm-variable-2 { color: black; } +body.visual-studio-ex .CodeMirror span.cm-tag { color: #800000; } +body.visual-studio-ex .CodeMirror span.cm-attribute { color: red; } +body.visual-studio-ex .CodeMirror span.cm-property { color: black; } + +body.visual-studio-ex .CodeMirror span.cm-matchhighlight{ + background-color: yellow; +} + +body.visual-studio-ex .CodeMirror .CodeMirror-selectedtext{ + background-color: #ADD6FF; +} + +body.visual-studio-ex .CodeMirror .CodeMirror-selected{ + background: transparent; +} + +body.visual-studio-ex .CodeMirror-focused .CodeMirror-selected{ + background: transparent; +} + diff --git a/MixERP.Net.FrontEnd/Scripts/CodeMirror/theme/visual-studio.css b/MixERP.Net.FrontEnd/Scripts/CodeMirror/theme/visual-studio.css new file mode 100644 index 000000000..36bc7aaf6 --- /dev/null +++ b/MixERP.Net.FrontEnd/Scripts/CodeMirror/theme/visual-studio.css @@ -0,0 +1,77 @@ +.cm-s-visual-studio.CodeMirror +{ + background-color: #fefefe; + color:black; +} + +.cm-s-visual-studio.CodeMirror .CodeMirror-lines pre +{ + z-index: 3; +} + +.cm-s-visual-studio.CodeMirror .CodeMirror-gutters +{ + background-color: #fefefe; +} + +.cm-s-visual-studio.CodeMirror .CodeMirror-linenumber +{ + color: #0E97A1; + background-color: #fefefe; +} + +.cm-s-visual-studio.CodeMirror .CodeMirror-matchingbracket +{ + color: black; + background-color: #dedede; +} + +.cm-s-visual-studio.CodeMirror .CodeMirror-linebackground +{ + outline: 2px solid #dddddd; + z-index: 3; +} + + +.cm-s-visual-studio.CodeMirror .cm-atom { color: red; } +.cm-s-visual-studio.CodeMirror .cm-qualifier { color: red; } + +/*CodeMirror does not add notation for css... Which would be really nice. */ +.cm-s-visual-studio.CodeMirror .cm-property { color: red; } + +.cm-s-visual-studio.CodeMirror .cm-keyword { color: blue; } +.cm-s-visual-studio.CodeMirror .cm-comment +{ + color: #009933; +} +.cm-s-visual-studio.CodeMirror .cm-string {color: red;} +.cm-s-visual-studio.CodeMirror .cm-string-2 {color: red;} +.cm-s-visual-studio.CodeMirror .cm-variable { color: black; } +.cm-s-visual-studio.CodeMirror .cm-variable-2 { color: black; } +.cm-s-visual-studio.CodeMirror .cm-tag { color: red; } +.cm-s-visual-studio.CodeMirror .cm-attribute { color: red; } +.cm-s-visual-studio.CodeMirror .cm-property { color: red; } +.cm-s-visual-studio.CodeMirror .cm-builtin { color: red; } +.cm-s-visual-studio.CodeMirror .cm-dateSQL { color: red; } +.cm-s-visual-studio.CodeMirror .cm-functions { color: blue; } + + +.cm-s-visual-studio.CodeMirror .cm-matchhighlight +{ + background-color: yellow; +} + +.cm-s-visual-studio.CodeMirror .CodeMirror-selectedtext +{ + background-color: #ADD6FF; +} + +.cm-s-visual-studio.CodeMirror .CodeMirror-selected +{ + background: #DED9F2; +} + +.cm-s-visual-studio.CodeMirror-focused .CodeMirror-selected +{ + background: #DED9F2; +} diff --git a/MixERP.Net.FrontEnd/Scripts/CodeMirror/theme/xq-dark.css b/MixERP.Net.FrontEnd/Scripts/CodeMirror/theme/xq-dark.css new file mode 100644 index 000000000..29fe6291c --- /dev/null +++ b/MixERP.Net.FrontEnd/Scripts/CodeMirror/theme/xq-dark.css @@ -0,0 +1,24 @@ +.cm-s-xq-dark.CodeMirror { background: #0a001f; color: #f8f8f8; } +.cm-s-xq-dark span.CodeMirror-selected { background: #a8f !important; } +.cm-s-xq-dark .CodeMirror-gutters { background: #0a001f; border-right: 1px solid #aaa; } +.cm-s-xq-dark .CodeMirror-linenumber { color: #f8f8f8; } +.cm-s-xq-dark .CodeMirror-cursor { border-left: 1px solid white !important; } + +.cm-s-xq-dark span.cm-keyword {color: #FFBD40;} +.cm-s-xq-dark span.cm-atom {color: #6C8CD5;} +.cm-s-xq-dark span.cm-number {color: #164;} +.cm-s-xq-dark span.cm-def {color: #FFF; text-decoration:underline;} +.cm-s-xq-dark span.cm-variable {color: #FFF;} +.cm-s-xq-dark span.cm-variable-2 {color: #EEE;} +.cm-s-xq-dark span.cm-variable-3 {color: #DDD;} +.cm-s-xq-dark span.cm-property {} +.cm-s-xq-dark span.cm-operator {} +.cm-s-xq-dark span.cm-comment {color: gray;} +.cm-s-xq-dark span.cm-string {color: #9FEE00;} +.cm-s-xq-dark span.cm-meta {color: yellow;} +.cm-s-xq-dark span.cm-error {color: #f00;} +.cm-s-xq-dark span.cm-qualifier {color: #FFF700;} +.cm-s-xq-dark span.cm-builtin {color: #30a;} +.cm-s-xq-dark span.cm-bracket {color: #cc7;} +.cm-s-xq-dark span.cm-tag {color: #FFBD40;} +.cm-s-xq-dark span.cm-attribute {color: #FFF700;} diff --git a/MixERP.Net.FrontEnd/Scripts/CodeMirror/theme/xq-light.css b/MixERP.Net.FrontEnd/Scripts/CodeMirror/theme/xq-light.css new file mode 100644 index 000000000..cd6bccbe5 --- /dev/null +++ b/MixERP.Net.FrontEnd/Scripts/CodeMirror/theme/xq-light.css @@ -0,0 +1,21 @@ +.cm-s-xq-light span.cm-keyword {line-height: 1em; font-weight: bold; color: #5A5CAD; } +.cm-s-xq-light span.cm-atom {color: #6C8CD5;} +.cm-s-xq-light span.cm-number {color: #164;} +.cm-s-xq-light span.cm-def {text-decoration:underline;} +.cm-s-xq-light span.cm-variable {color: black; } +.cm-s-xq-light span.cm-variable-2 {color:black;} +.cm-s-xq-light span.cm-variable-3 {color: black; } +.cm-s-xq-light span.cm-property {} +.cm-s-xq-light span.cm-operator {} +.cm-s-xq-light span.cm-comment {color: #0080FF; font-style: italic;} +.cm-s-xq-light span.cm-string {color: red;} +.cm-s-xq-light span.cm-meta {color: yellow;} +.cm-s-xq-light span.cm-error {color: #f00;} +.cm-s-xq-light span.cm-qualifier {color: grey} +.cm-s-xq-light span.cm-builtin {color: #7EA656;} +.cm-s-xq-light span.cm-bracket {color: #cc7;} +.cm-s-xq-light span.cm-tag {color: #3F7F7F;} +.cm-s-xq-light span.cm-attribute {color: #7F007F;} + +.cm-s-xq-light .CodeMirror-activeline-background {background: #e8f2ff !important;} +.cm-s-xq-light .CodeMirror-matchingbracket {border:1px solid grey;color:black !important;background:yellow;} \ No newline at end of file diff --git a/MixERP.Net.FrontEnd/Scripts/colorbox/colorbox.css b/MixERP.Net.FrontEnd/Scripts/colorbox/colorbox.css new file mode 100644 index 000000000..19c833261 --- /dev/null +++ b/MixERP.Net.FrontEnd/Scripts/colorbox/colorbox.css @@ -0,0 +1,44 @@ +/* + Colorbox Core Style: + The following CSS is consistent between example themes and should not be altered. +*/ +#colorbox, #cboxOverlay, #cboxWrapper{position:absolute; top:0; left:0; z-index:9999; overflow:hidden;} +#cboxOverlay{position:fixed; width:100%; height:100%;} +#cboxMiddleLeft, #cboxBottomLeft{clear:left;} +#cboxContent{position:relative;} +#cboxLoadedContent{overflow:auto; -webkit-overflow-scrolling: touch;} +#cboxTitle{margin:0;} +#cboxLoadingOverlay, #cboxLoadingGraphic{position:absolute; top:0; left:0; width:100%; height:100%;} +#cboxPrevious, #cboxNext, #cboxClose, #cboxSlideshow{cursor:pointer;} +.cboxPhoto{float:left; margin:auto; border:0; display:block; max-width:none; -ms-interpolation-mode:bicubic;} +.cboxIframe{width:100%; height:100%; display:block; border:0;} +#colorbox, #cboxContent, #cboxLoadedContent{box-sizing:content-box; -moz-box-sizing:content-box; -webkit-box-sizing:content-box;} + +/* + User Style: + Change the following styles to modify the appearance of Colorbox. They are + ordered & tabbed in a way that represents the nesting of the generated HTML. +*/ +#cboxOverlay{background:#000;} +#colorbox{outline:0;} + #cboxContent{margin-top:20px;background:#000;} + .cboxIframe{background:#fff;} + #cboxError{padding:50px; border:1px solid #ccc;} + #cboxLoadedContent{border:5px solid #000; background:#fff;} + #cboxTitle{position:absolute; top:-20px; left:0; color:#ccc;} + #cboxCurrent{position:absolute; top:-20px; right:0px; color:#ccc;} + #cboxLoadingGraphic{background:url(images/loading.gif) no-repeat center center;} + + /* these elements are buttons, and may need to have additional styles reset to avoid unwanted base styles */ + #cboxPrevious, #cboxNext, #cboxSlideshow, #cboxClose {border:0; padding:0; margin:0; overflow:visible; width:auto; background:none; } + + /* avoid outlines on :active (mouseclick), but preserve outlines on :focus (tabbed navigating) */ + #cboxPrevious:active, #cboxNext:active, #cboxSlideshow:active, #cboxClose:active {outline:0;} + + #cboxSlideshow{position:absolute; top:-20px; right:90px; color:#fff;} + #cboxPrevious{position:absolute; top:50%; left:5px; margin-top:-32px; background:url(images/controls.png) no-repeat top left; width:28px; height:65px; text-indent:-9999px;} + #cboxPrevious:hover{background-position:bottom left;} + #cboxNext{position:absolute; top:50%; right:5px; margin-top:-32px; background:url(images/controls.png) no-repeat top right; width:28px; height:65px; text-indent:-9999px;} + #cboxNext:hover{background-position:bottom right;} + #cboxClose{position:absolute; top:5px; right:5px; display:block; background:url(images/controls.png) no-repeat top center; width:38px; height:19px; text-indent:-9999px;} + #cboxClose:hover{background-position:bottom center;} \ No newline at end of file diff --git a/MixERP.Net.FrontEnd/Scripts/colorbox/i18n/jquery.colorbox-ar.js b/MixERP.Net.FrontEnd/Scripts/colorbox/i18n/jquery.colorbox-ar.js new file mode 100644 index 000000000..6c4228cd1 --- /dev/null +++ b/MixERP.Net.FrontEnd/Scripts/colorbox/i18n/jquery.colorbox-ar.js @@ -0,0 +1,15 @@ +/* + jQuery Colorbox language configuration + language: Arabic (ar) + translated by: A.Rhman Sayes +*/ +jQuery.extend(jQuery.colorbox.settings, { + current: "الصورة {current} من {total}", + previous: "السابق", + next: "التالي", + close: "إغلاق", + xhrError: "حدث خطأ أثناء تحميل المحتوى.", + imgError: "حدث خطأ أثناء تحميل الصورة.", + slideshowStart: "تشغيل العرض", + slideshowStop: "إيقاف العرض" +}); diff --git a/MixERP.Net.FrontEnd/Scripts/colorbox/i18n/jquery.colorbox-bg.js b/MixERP.Net.FrontEnd/Scripts/colorbox/i18n/jquery.colorbox-bg.js new file mode 100644 index 000000000..de7e4a1d0 --- /dev/null +++ b/MixERP.Net.FrontEnd/Scripts/colorbox/i18n/jquery.colorbox-bg.js @@ -0,0 +1,16 @@ +/* + jQuery Colorbox language configuration + language: Bulgarian (bg) + translated by: Marian M.Bida + site: webmax.bg +*/ +jQuery.extend(jQuery.colorbox.settings, { + current: "изображение {current} от {total}", + previous: "предишна", + next: "следваща", + close: "затвори", + xhrError: "Неуспешно зареждане на съдържанието.", + imgError: "Неуспешно зареждане на изображението.", + slideshowStart: "пусни слайд-шоу", + slideshowStop: "спри слайд-шоу" +}); diff --git a/MixERP.Net.FrontEnd/Scripts/colorbox/i18n/jquery.colorbox-cs.js b/MixERP.Net.FrontEnd/Scripts/colorbox/i18n/jquery.colorbox-cs.js new file mode 100644 index 000000000..9649fd455 --- /dev/null +++ b/MixERP.Net.FrontEnd/Scripts/colorbox/i18n/jquery.colorbox-cs.js @@ -0,0 +1,16 @@ +/* + jQuery Colorbox language configuration + language: Czech (cs) + translated by: Filip Novak + site: mame.napilno.cz/filip-novak +*/ +jQuery.extend(jQuery.colorbox.settings, { + current: "{current}. obrázek z {total}", + previous: "Předchozí", + next: "Následující", + close: "Zavřít", + xhrError: "Obsah se nepodařilo načíst.", + imgError: "Obrázek se nepodařilo načíst.", + slideshowStart: "Spustit slideshow", + slideshowStop: "Zastavit slideshow" +}); \ No newline at end of file diff --git a/MixERP.Net.FrontEnd/Scripts/colorbox/i18n/jquery.colorbox-da.js b/MixERP.Net.FrontEnd/Scripts/colorbox/i18n/jquery.colorbox-da.js new file mode 100644 index 000000000..676fffed2 --- /dev/null +++ b/MixERP.Net.FrontEnd/Scripts/colorbox/i18n/jquery.colorbox-da.js @@ -0,0 +1,16 @@ +/* + jQuery Colorbox language configuration + language: Danish (da) + translated by: danieljuhl + site: danieljuhl.dk +*/ +jQuery.extend(jQuery.colorbox.settings, { + current: "Billede {current} af {total}", + previous: "Forrige", + next: "Næste", + close: "Luk", + xhrError: "Indholdet fejlede i indlæsningen.", + imgError: "Billedet fejlede i indlæsningen.", + slideshowStart: "Start slideshow", + slideshowStop: "Stop slideshow" +}); diff --git a/MixERP.Net.FrontEnd/Scripts/colorbox/i18n/jquery.colorbox-de.js b/MixERP.Net.FrontEnd/Scripts/colorbox/i18n/jquery.colorbox-de.js new file mode 100644 index 000000000..d489379bc --- /dev/null +++ b/MixERP.Net.FrontEnd/Scripts/colorbox/i18n/jquery.colorbox-de.js @@ -0,0 +1,15 @@ +/* + jQuery Colorbox language configuration + language: German (de) + translated by: wallenium +*/ +jQuery.extend(jQuery.colorbox.settings, { + current: "Bild {current} von {total}", + previous: "Zurück", + next: "Vor", + close: "Schließen", + xhrError: "Dieser Inhalt konnte nicht geladen werden.", + imgError: "Dieses Bild konnte nicht geladen werden.", + slideshowStart: "Slideshow starten", + slideshowStop: "Slideshow anhalten" +}); \ No newline at end of file diff --git a/MixERP.Net.FrontEnd/Scripts/colorbox/i18n/jquery.colorbox-es.js b/MixERP.Net.FrontEnd/Scripts/colorbox/i18n/jquery.colorbox-es.js new file mode 100644 index 000000000..11296fc94 --- /dev/null +++ b/MixERP.Net.FrontEnd/Scripts/colorbox/i18n/jquery.colorbox-es.js @@ -0,0 +1,13 @@ +/* + jQuery Colorbox language configuration + language: Spanish (es) + translated by: migolo +*/ +jQuery.extend(jQuery.colorbox.settings, { + current: "Imagen {current} de {total}", + previous: "Anterior", + next: "Siguiente", + close: "Cerrar", + xhrError: "Error en la carga del contenido.", + imgError: "Error en la carga de la imagen." +}); diff --git a/MixERP.Net.FrontEnd/Scripts/colorbox/i18n/jquery.colorbox-et.js b/MixERP.Net.FrontEnd/Scripts/colorbox/i18n/jquery.colorbox-et.js new file mode 100644 index 000000000..60a4e888e --- /dev/null +++ b/MixERP.Net.FrontEnd/Scripts/colorbox/i18n/jquery.colorbox-et.js @@ -0,0 +1,15 @@ +/* + jQuery Colorbox language configuration + language: Estonian (et) + translated by: keevitaja +*/ +jQuery.extend(jQuery.colorbox.settings, { + current: "{current}/{total}", + previous: "eelmine", + next: "järgmine", + close: "sulge", + xhrError: "Sisu ei õnnestunud laadida.", + imgError: "Pilti ei õnnestunud laadida.", + slideshowStart: "Käivita slaidid", + slideshowStop: "Peata slaidid" +}); \ No newline at end of file diff --git a/MixERP.Net.FrontEnd/Scripts/colorbox/i18n/jquery.colorbox-fa.js b/MixERP.Net.FrontEnd/Scripts/colorbox/i18n/jquery.colorbox-fa.js new file mode 100644 index 000000000..dbe70e1ab --- /dev/null +++ b/MixERP.Net.FrontEnd/Scripts/colorbox/i18n/jquery.colorbox-fa.js @@ -0,0 +1,18 @@ +/* + jQuery Colorbox language configuration + language: Persian (Farsi) + translated by: Mahdi Jaberzadeh Ansari (MJZSoft) + site: www.mjzsoft.ir + email: mahdijaberzadehansari (at) yahoo.co.uk + Please note : Persian language is right to left like arabic. +*/ +jQuery.extend(jQuery.colorbox.settings, { + current: "تصویر {current} از {total}", + previous: "قبلی", + next: "بعدی", + close: "بستن", + xhrError: "متاسفانه محتویات مورد نظر قابل نمایش نیست.", + imgError: "متاسفانه بارگذاری این عکس با مشکل مواجه شده است.", + slideshowStart: "آغاز نمایش خودکار", + slideshowStop: "توقف نمایش خودکار" +}); diff --git a/MixERP.Net.FrontEnd/Scripts/colorbox/i18n/jquery.colorbox-fi.js b/MixERP.Net.FrontEnd/Scripts/colorbox/i18n/jquery.colorbox-fi.js new file mode 100644 index 000000000..ac03fe021 --- /dev/null +++ b/MixERP.Net.FrontEnd/Scripts/colorbox/i18n/jquery.colorbox-fi.js @@ -0,0 +1,15 @@ +/* + jQuery Colorbox language configuration + language: Finnish (fi) + translated by: Mikko +*/ +jQuery.extend(jQuery.colorbox.settings, { + current: "Kuva {current} / {total}", + previous: "Edellinen", + next: "Seuraava", + close: "Sulje", + xhrError: "Sisällön lataaminen epäonnistui.", + imgError: "Kuvan lataaminen epäonnistui.", + slideshowStart: "Aloita kuvaesitys.", + slideshowStop: "Lopeta kuvaesitys." +}); diff --git a/MixERP.Net.FrontEnd/Scripts/colorbox/i18n/jquery.colorbox-fr.js b/MixERP.Net.FrontEnd/Scripts/colorbox/i18n/jquery.colorbox-fr.js new file mode 100644 index 000000000..f76352bd4 --- /dev/null +++ b/MixERP.Net.FrontEnd/Scripts/colorbox/i18n/jquery.colorbox-fr.js @@ -0,0 +1,15 @@ +/* + jQuery Colorbox language configuration + language: French (fr) + translated by: oaubert +*/ +jQuery.extend(jQuery.colorbox.settings, { + current: "image {current} sur {total}", + previous: "précédente", + next: "suivante", + close: "fermer", + xhrError: "Impossible de charger ce contenu.", + imgError: "Impossible de charger cette image.", + slideshowStart: "démarrer la présentation", + slideshowStop: "arrêter la présentation" +}); diff --git a/MixERP.Net.FrontEnd/Scripts/colorbox/i18n/jquery.colorbox-hr.js b/MixERP.Net.FrontEnd/Scripts/colorbox/i18n/jquery.colorbox-hr.js new file mode 100644 index 000000000..9e0d0f486 --- /dev/null +++ b/MixERP.Net.FrontEnd/Scripts/colorbox/i18n/jquery.colorbox-hr.js @@ -0,0 +1,15 @@ +/* + jQuery Colorbox language configuration + language: Croatian (hr) + translated by: Mladen Bicanic (base.hr) +*/ +jQuery.extend(jQuery.colorbox.settings, { + current: "Slika {current} od {total}", + previous: "Prethodna", + next: "Sljedeća", + close: "Zatvori", + xhrError: "Neuspješno učitavanje sadržaja.", + imgError: "Neuspješno učitavanje slike.", + slideshowStart: "Pokreni slideshow", + slideshowStop: "Zaustavi slideshow" +}); \ No newline at end of file diff --git a/MixERP.Net.FrontEnd/Scripts/colorbox/i18n/jquery.colorbox-hu.js b/MixERP.Net.FrontEnd/Scripts/colorbox/i18n/jquery.colorbox-hu.js new file mode 100644 index 000000000..72e9d36b1 --- /dev/null +++ b/MixERP.Net.FrontEnd/Scripts/colorbox/i18n/jquery.colorbox-hu.js @@ -0,0 +1,15 @@ +/* + jQuery Colorbox language configuration + language: Hungarian (hu) + translated by: kovadani +*/ +jQuery.extend(jQuery.colorbox.settings, { + current: "{current}/{total} kép", + previous: "Előző", + next: "Következő", + close: "Bezár", + xhrError: "A tartalmat nem sikerült betölteni.", + imgError: "A képet nem sikerült betölteni.", + slideshowStart: "Diavetítés indítása", + slideshowStop: "Diavetítés leállítása" +}); \ No newline at end of file diff --git a/MixERP.Net.FrontEnd/Scripts/colorbox/i18n/jquery.colorbox-id.js b/MixERP.Net.FrontEnd/Scripts/colorbox/i18n/jquery.colorbox-id.js new file mode 100644 index 000000000..81a62df34 --- /dev/null +++ b/MixERP.Net.FrontEnd/Scripts/colorbox/i18n/jquery.colorbox-id.js @@ -0,0 +1,15 @@ +/* + jQuery Colorbox language configuration + language: Indonesian (id) + translated by: sarwasunda +*/ +jQuery.extend(jQuery.colorbox.settings, { + current: "ke {current} dari {total}", + previous: "Sebelumnya", + next: "Berikutnya", + close: "Tutup", + xhrError: "Konten ini tidak dapat dimuat.", + imgError: "Gambar ini tidak dapat dimuat.", + slideshowStart: "Putar", + slideshowStop: "Berhenti" +}); diff --git a/MixERP.Net.FrontEnd/Scripts/colorbox/i18n/jquery.colorbox-it.js b/MixERP.Net.FrontEnd/Scripts/colorbox/i18n/jquery.colorbox-it.js new file mode 100644 index 000000000..2a4af6453 --- /dev/null +++ b/MixERP.Net.FrontEnd/Scripts/colorbox/i18n/jquery.colorbox-it.js @@ -0,0 +1,15 @@ +/* + jQuery Colorbox language configuration + language: Italian (it) + translated by: maur8ino +*/ +jQuery.extend(jQuery.colorbox.settings, { + current: "Immagine {current} di {total}", + previous: "Precedente", + next: "Successiva", + close: "Chiudi", + xhrError: "Errore nel caricamento del contenuto.", + imgError: "Errore nel caricamento dell'immagine.", + slideshowStart: "Inizia la presentazione", + slideshowStop: "Termina la presentazione" +}); diff --git a/MixERP.Net.FrontEnd/Scripts/colorbox/i18n/jquery.colorbox-ja.js b/MixERP.Net.FrontEnd/Scripts/colorbox/i18n/jquery.colorbox-ja.js new file mode 100644 index 000000000..067612c08 --- /dev/null +++ b/MixERP.Net.FrontEnd/Scripts/colorbox/i18n/jquery.colorbox-ja.js @@ -0,0 +1,15 @@ +/* + jQuery Colorbox language configuration + language: Japanaese (ja) + translated by: Hajime Fujimoto +*/ +jQuery.extend(jQuery.colorbox.settings, { + current: "{total}枚中{current}枚目", + previous: "前", + next: "次", + close: "閉じる", + xhrError: "コンテンツの読み込みに失敗しました", + imgError: "画像の読み込みに失敗しました", + slideshowStart: "スライドショー開始", + slideshowStop: "スライドショー終了" +}); diff --git a/MixERP.Net.FrontEnd/Scripts/colorbox/i18n/jquery.colorbox-kr.js b/MixERP.Net.FrontEnd/Scripts/colorbox/i18n/jquery.colorbox-kr.js new file mode 100644 index 000000000..b95702bc0 --- /dev/null +++ b/MixERP.Net.FrontEnd/Scripts/colorbox/i18n/jquery.colorbox-kr.js @@ -0,0 +1,15 @@ +/* + jQuery Colorbox language configuration + language: Korean (kr) + translated by: lunareffect +*/ +jQuery.extend(jQuery.colorbox.settings, { + current: "총 {total} 중 {current}", + previous: "이전", + next: "다음", + close: "닫기", + xhrError: "컨텐츠를 불러오는 데 실패했습니다.", + imgError: "이미지를 불러오는 데 실패했습니다.", + slideshowStart: "슬라이드쇼 시작", + slideshowStop: "슬라이드쇼 중지" +}); diff --git a/MixERP.Net.FrontEnd/Scripts/colorbox/i18n/jquery.colorbox-lv.js b/MixERP.Net.FrontEnd/Scripts/colorbox/i18n/jquery.colorbox-lv.js new file mode 100644 index 000000000..e376366b9 --- /dev/null +++ b/MixERP.Net.FrontEnd/Scripts/colorbox/i18n/jquery.colorbox-lv.js @@ -0,0 +1,16 @@ +/* + jQuery Colorbox language configuration + language: Latvian (lv) + translated by: Matiss Roberts Treinis + site: x0.lv +*/ +jQuery.extend(jQuery.colorbox.settings, { + current: "attēls {current} no {total}", + previous: "iepriekšējais", + next: "nākamais", + close: "aizvērt", + xhrError: "Neizdevās ielādēt saturu.", + imgError: "Neizdevās ielādēt attēlu.", + slideshowStart: "sākt slaidrādi", + slideshowStop: "apturēt slaidrādi" +}); diff --git a/MixERP.Net.FrontEnd/Scripts/colorbox/i18n/jquery.colorbox-nl.js b/MixERP.Net.FrontEnd/Scripts/colorbox/i18n/jquery.colorbox-nl.js new file mode 100644 index 000000000..dfc658ec9 --- /dev/null +++ b/MixERP.Net.FrontEnd/Scripts/colorbox/i18n/jquery.colorbox-nl.js @@ -0,0 +1,15 @@ +/* + jQuery Colorbox language configuration + language: Dutch (nl) + translated by: barryvdh +*/ +jQuery.extend(jQuery.colorbox.settings, { + current: "Afbeelding {current} van {total}", + previous: "Vorige", + next: "Volgende", + close: "Sluiten", + xhrError: "Deze inhoud kan niet geladen worden.", + imgError: "Deze afbeelding kan niet geladen worden.", + slideshowStart: "Diashow starten", + slideshowStop: "Diashow stoppen" +}); \ No newline at end of file diff --git a/MixERP.Net.FrontEnd/Scripts/colorbox/i18n/jquery.colorbox-no.js b/MixERP.Net.FrontEnd/Scripts/colorbox/i18n/jquery.colorbox-no.js new file mode 100644 index 000000000..277c5d3f9 --- /dev/null +++ b/MixERP.Net.FrontEnd/Scripts/colorbox/i18n/jquery.colorbox-no.js @@ -0,0 +1,16 @@ +/* + jQuery Colorbox language configuration + language: Norwegian (no) + translated by: lars-erik + site: markedspartner.no +*/ +jQuery.extend(jQuery.colorbox.settings, { + current: "Bilde {current} av {total}", + previous: "Forrige", + next: "Neste", + close: "Lukk", + xhrError: "Feil ved lasting av innhold.", + imgError: "Feil ved lasting av bilde.", + slideshowStart: "Start lysbildefremvisning", + slideshowStop: "Stopp lysbildefremvisning" +}); diff --git a/MixERP.Net.FrontEnd/Scripts/colorbox/i18n/jquery.colorbox-pl.js b/MixERP.Net.FrontEnd/Scripts/colorbox/i18n/jquery.colorbox-pl.js new file mode 100644 index 000000000..8cbdcab2d --- /dev/null +++ b/MixERP.Net.FrontEnd/Scripts/colorbox/i18n/jquery.colorbox-pl.js @@ -0,0 +1,16 @@ +/* + jQuery Colorbox language configuration + language: Polski (pl) + translated by: Tomasz Wasiński + site: 2bevisible.pl +*/ +jQuery.extend(jQuery.colorbox.settings, { + current: "{current}. obrazek z {total}", + previous: "Poprzedni", + next: "Następny", + close: "Zamknij", + xhrError: "Nie udało się załadować treści.", + imgError: "Nie udało się załadować obrazka.", + slideshowStart: "rozpocznij pokaz slajdów", + slideshowStop: "zatrzymaj pokaz slajdów" +}); \ No newline at end of file diff --git a/MixERP.Net.FrontEnd/Scripts/colorbox/i18n/jquery.colorbox-pt-br.js b/MixERP.Net.FrontEnd/Scripts/colorbox/i18n/jquery.colorbox-pt-br.js new file mode 100644 index 000000000..73e948b7f --- /dev/null +++ b/MixERP.Net.FrontEnd/Scripts/colorbox/i18n/jquery.colorbox-pt-br.js @@ -0,0 +1,15 @@ +/* + jQuery Colorbox language configuration + language: Brazilian Portuguese (pt-br) + translated by: ReinaldoMT +*/ +jQuery.extend(jQuery.colorbox.settings, { + current: "Imagem {current} de {total}", + previous: "Anterior", + next: "Próxima", + close: "Fechar", + slideshowStart: "iniciar apresentação de slides", + slideshowStop: "parar apresentação de slides", + xhrError: "Erro ao carregar o conteúdo.", + imgError: "Erro ao carregar a imagem." +}); \ No newline at end of file diff --git a/MixERP.Net.FrontEnd/Scripts/colorbox/i18n/jquery.colorbox-ro.js b/MixERP.Net.FrontEnd/Scripts/colorbox/i18n/jquery.colorbox-ro.js new file mode 100644 index 000000000..0a461e28a --- /dev/null +++ b/MixERP.Net.FrontEnd/Scripts/colorbox/i18n/jquery.colorbox-ro.js @@ -0,0 +1,15 @@ +/* + jQuery Colorbox language configuration + language: Romanian (ro) + translated by: shurub3l +*/ +jQuery.extend(jQuery.colorbox.settings, { + current: "imagine {current} din {total}", + previous: "precedenta", + next: "următoarea", + close: "închideți", + xhrError: "Acest conținut nu poate fi încărcat.", + imgError: "Această imagine nu poate fi încărcată", + slideshowStart: "începeți prezentarea (slideshow)", + slideshowStop: "opriți prezentarea (slideshow)" +}); \ No newline at end of file diff --git a/MixERP.Net.FrontEnd/Scripts/colorbox/i18n/jquery.colorbox-ru.js b/MixERP.Net.FrontEnd/Scripts/colorbox/i18n/jquery.colorbox-ru.js new file mode 100644 index 000000000..81b688f2c --- /dev/null +++ b/MixERP.Net.FrontEnd/Scripts/colorbox/i18n/jquery.colorbox-ru.js @@ -0,0 +1,16 @@ +/* + jQuery Colorbox language configuration + language: Russian (ru) + translated by: Marfa + site: themarfa.name +*/ +jQuery.extend(jQuery.colorbox.settings, { + current: "изображение {current} из {total}", + previous: "назад", + next: "вперёд", + close: "закрыть", + xhrError: "Не удалось загрузить содержимое.", + imgError: "Не удалось загрузить изображение.", + slideshowStart: "начать слайд-шоу", + slideshowStop: "остановить слайд-шоу" +}); \ No newline at end of file diff --git a/MixERP.Net.FrontEnd/Scripts/colorbox/i18n/jquery.colorbox-sk.js b/MixERP.Net.FrontEnd/Scripts/colorbox/i18n/jquery.colorbox-sk.js new file mode 100644 index 000000000..faa9291cb --- /dev/null +++ b/MixERP.Net.FrontEnd/Scripts/colorbox/i18n/jquery.colorbox-sk.js @@ -0,0 +1,15 @@ +/* + jQuery Colorbox language configuration + language: Slovak (sk) + translated by: Jaroslav Kostal +*/ +jQuery.extend(jQuery.colorbox.settings, { + current: "{current}. obrázok z {total}", + previous: "Predchádzajúci", + next: "Následujúci", + close: "Zatvoriť", + xhrError: "Obsah sa nepodarilo načítať.", + imgError: "Obrázok sa nepodarilo načítať.", + slideshowStart: "Spustiť slideshow", + slideshowStop: "zastaviť slideshow" +}); \ No newline at end of file diff --git a/MixERP.Net.FrontEnd/Scripts/colorbox/i18n/jquery.colorbox-sv.js b/MixERP.Net.FrontEnd/Scripts/colorbox/i18n/jquery.colorbox-sv.js new file mode 100644 index 000000000..01bb1d8c6 --- /dev/null +++ b/MixERP.Net.FrontEnd/Scripts/colorbox/i18n/jquery.colorbox-sv.js @@ -0,0 +1,15 @@ +/* + jQuery Colorbox language configuration + language: Swedish (sv) + translated by: Mattias Reichel +*/ +jQuery.extend(jQuery.colorbox.settings, { + current: "Bild {current} av {total}", + previous: "Föregående", + next: "Nästa", + close: "Stäng", + xhrError: "Innehållet kunde inte laddas.", + imgError: "Den här bilden kunde inte laddas.", + slideshowStart: "Starta bildspel", + slideshowStop: "Stoppa bildspel" +}); \ No newline at end of file diff --git a/MixERP.Net.FrontEnd/Scripts/colorbox/i18n/jquery.colorbox-tr.js b/MixERP.Net.FrontEnd/Scripts/colorbox/i18n/jquery.colorbox-tr.js new file mode 100644 index 000000000..d467c2ef1 --- /dev/null +++ b/MixERP.Net.FrontEnd/Scripts/colorbox/i18n/jquery.colorbox-tr.js @@ -0,0 +1,19 @@ +/* + jQuery Colorbox language configuration + language: Turkish (tr) + translated by: Caner ÖNCEL + site: egonomik.com + + edited by: Sinan Eldem + www.sinaneldem.com.tr +*/ +jQuery.extend(jQuery.colorbox.settings, { + current: "Görsel {current} / {total}", + previous: "Önceki", + next: "Sonraki", + close: "Kapat", + xhrError: "İçerik yüklenirken hata meydana geldi.", + imgError: "Resim yüklenirken hata meydana geldi.", + slideshowStart: "Slaytı Başlat", + slideshowStop: "Slaytı Durdur" +}); diff --git a/MixERP.Net.FrontEnd/Scripts/colorbox/i18n/jquery.colorbox-zh-CN.js b/MixERP.Net.FrontEnd/Scripts/colorbox/i18n/jquery.colorbox-zh-CN.js new file mode 100644 index 000000000..5b6ec042d --- /dev/null +++ b/MixERP.Net.FrontEnd/Scripts/colorbox/i18n/jquery.colorbox-zh-CN.js @@ -0,0 +1,15 @@ +/* + jQuery Colorbox language configuration + language: Chinese Simplified (zh-CN) + translated by: zhao weiming +*/ +jQuery.extend(jQuery.colorbox.settings, { + current: "当前图像 {current} 总共 {total}", + previous: "前一页", + next: "后一页", + close: "关闭", + xhrError: "此内容无法加载", + imgError: "此图片无法加载", + slideshowStart: "开始播放幻灯片", + slideshowStop: "停止播放幻灯片" +}); \ No newline at end of file diff --git a/MixERP.Net.FrontEnd/Scripts/colorbox/images/controls.png b/MixERP.Net.FrontEnd/Scripts/colorbox/images/controls.png new file mode 100644 index 000000000..e1e97982a Binary files /dev/null and b/MixERP.Net.FrontEnd/Scripts/colorbox/images/controls.png differ diff --git a/MixERP.Net.FrontEnd/Scripts/colorbox/images/loading.gif b/MixERP.Net.FrontEnd/Scripts/colorbox/images/loading.gif new file mode 100644 index 000000000..19c67bbd0 Binary files /dev/null and b/MixERP.Net.FrontEnd/Scripts/colorbox/images/loading.gif differ diff --git a/MixERP.Net.FrontEnd/Scripts/colorbox/jquery.colorbox-min.js b/MixERP.Net.FrontEnd/Scripts/colorbox/jquery.colorbox-min.js new file mode 100644 index 000000000..230da8fe0 --- /dev/null +++ b/MixERP.Net.FrontEnd/Scripts/colorbox/jquery.colorbox-min.js @@ -0,0 +1,7 @@ +/*! + Colorbox v1.4.27 - 2013-07-16 + jQuery lightbox and modal window plugin + (c) 2013 Jack Moore - http://www.jacklmoore.com/colorbox + license: http://www.opensource.org/licenses/mit-license.php +*/ +(function(t,e,i){function o(i,o,n){var r=e.createElement(i);return o&&(r.id=te+o),n&&(r.style.cssText=n),t(r)}function n(){return i.innerHeight?i.innerHeight:t(i).height()}function r(t){var e=E.length,i=(j+t)%e;return 0>i?e+i:i}function l(t,e){return Math.round((/%/.test(t)?("x"===e?H.width():n())/100:1)*parseInt(t,10))}function h(t,e){return t.photo||t.photoRegex.test(e)}function s(t,e){return t.retinaUrl&&i.devicePixelRatio>1?e.replace(t.photoRegex,t.retinaSuffix):e}function a(t){"contains"in v[0]&&!v[0].contains(t.target)&&(t.stopPropagation(),v.focus())}function d(){var e,i=t.data(A,Z);null==i?(O=t.extend({},Y),console&&console.log&&console.log("Error: cboxElement missing settings object")):O=t.extend({},i);for(e in O)t.isFunction(O[e])&&"on"!==e.slice(0,2)&&(O[e]=O[e].call(A));O.rel=O.rel||A.rel||t(A).data("rel")||"nofollow",O.href=O.href||t(A).attr("href"),O.title=O.title||A.title,"string"==typeof O.href&&(O.href=t.trim(O.href))}function c(i,o){t(e).trigger(i),se.trigger(i),t.isFunction(o)&&o.call(A)}function u(){var t,e,i,o,n,r=te+"Slideshow_",l="click."+te;O.slideshow&&E[1]?(e=function(){clearTimeout(t)},i=function(){(O.loop||E[j+1])&&(t=setTimeout(J.next,O.slideshowSpeed))},o=function(){R.html(O.slideshowStop).unbind(l).one(l,n),se.bind(ne,i).bind(oe,e).bind(re,n),v.removeClass(r+"off").addClass(r+"on")},n=function(){e(),se.unbind(ne,i).unbind(oe,e).unbind(re,n),R.html(O.slideshowStart).unbind(l).one(l,function(){J.next(),o()}),v.removeClass(r+"on").addClass(r+"off")},O.slideshowAuto?o():n()):v.removeClass(r+"off "+r+"on")}function p(i){G||(A=i,d(),E=t(A),j=0,"nofollow"!==O.rel&&(E=t("."+ee).filter(function(){var e,i=t.data(this,Z);return i&&(e=t(this).data("rel")||i.rel||this.rel),e===O.rel}),j=E.index(A),-1===j&&(E=E.add(A),j=E.length-1)),g.css({opacity:parseFloat(O.opacity),cursor:O.overlayClose?"pointer":"auto",visibility:"visible"}).show(),V&&v.add(g).removeClass(V),O.className&&v.add(g).addClass(O.className),V=O.className,O.closeButton?P.html(O.close).appendTo(x):P.appendTo("
    "),$||($=q=!0,v.css({visibility:"hidden",display:"block"}),W=o(ae,"LoadedContent","width:0; height:0; overflow:hidden"),x.css({width:"",height:""}).append(W),_=b.height()+k.height()+x.outerHeight(!0)-x.height(),D=T.width()+C.width()+x.outerWidth(!0)-x.width(),N=W.outerHeight(!0),z=W.outerWidth(!0),O.w=l(O.initialWidth,"x"),O.h=l(O.initialHeight,"y"),J.position(),u(),c(ie,O.onOpen),B.add(S).hide(),v.focus(),O.trapFocus&&e.addEventListener&&(e.addEventListener("focus",a,!0),se.one(le,function(){e.removeEventListener("focus",a,!0)})),O.returnFocus&&se.one(le,function(){t(A).focus()})),w())}function f(){!v&&e.body&&(X=!1,H=t(i),v=o(ae).attr({id:Z,"class":t.support.opacity===!1?te+"IE":"",role:"dialog",tabindex:"-1"}).hide(),g=o(ae,"Overlay").hide(),L=t([o(ae,"LoadingOverlay")[0],o(ae,"LoadingGraphic")[0]]),y=o(ae,"Wrapper"),x=o(ae,"Content").append(S=o(ae,"Title"),M=o(ae,"Current"),K=t('
    + + + + 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" %> + + + + +
    + progress +
    +
    +
    + +

    + +

    +
    + + + + + + + + + + + + + +
    + + + + + + + + + + + +
    + + + + + + + + + + + + + + + + + +
    + + + + + +

    + + + + + + + + + + + + +

    +

    +

    + + + +
    +
    + + diff --git a/MixERP.Net.FrontEnd/UserControls/Forms/FormControl.ascx.cs b/MixERP.Net.FrontEnd/UserControls/Forms/FormControl.ascx.cs new file mode 100644 index 000000000..a7228b8d8 --- /dev/null +++ b/MixERP.Net.FrontEnd/UserControls/Forms/FormControl.ascx.cs @@ -0,0 +1,1097 @@ +/******************************************************************************** +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; +using System.Collections.Generic; +using System.Data; +using System.Globalization; +using System.Linq; +using System.Web; +using System.Web.UI; +using System.Web.UI.HtmlControls; +using System.Web.UI.WebControls; + +namespace MixERP.Net.FrontEnd.UserControls.Forms +{ + public partial class FormControl : System.Web.UI.UserControl + { + private string imageColumn = string.Empty; + + #region Properties + public bool DenyEdit { get; set; } + public bool DenyDelete { get; set; } + public bool DenyAdd { get; set; } + public string Description { get; set; } + public string DisplayFields { get; set; } + public string DisplayViews { get; set; } + public string Exclude { get; set; } + public string KeyColumn { get; set; } + public int PageSize { get; set; } + public string SelectedValues { get; set; } + public string Table { get; set; } + public string TableSchema { get; set; } + public string Text { get; set; } + public string View { get; set; } + public string ViewSchema { get; set; } + public int Width { get; set; } + #endregion + + #region Control Events + protected void Page_Load(object sender, EventArgs e) + { + TitleLabel.Text = this.Text; + this.Page.Title = this.Text; + + if(!string.IsNullOrWhiteSpace(this.Description)) + { + DescriptionLabel.CssClass = "description"; + DescriptionLabel.Text = this.Description; + } + + this.LoadGrid(); + using(System.Data.DataTable table = new System.Data.DataTable()) + { + table.Locale = System.Threading.Thread.CurrentThread.CurrentCulture; + this.LoadForm(this.FormContainer, table); + } + } + + protected void FormGridView_RowDataBound(object sender, GridViewRowEventArgs e) + { + if(e.Row.RowType == DataControlRowType.DataRow) + { + HtmlInputRadioButton radio = new HtmlInputRadioButton(); + radio.ClientIDMode = System.Web.UI.ClientIDMode.Static; + radio.Name = "SelectRadio"; + radio.ID = "SelectRadio"; + radio.ClientIDMode = System.Web.UI.ClientIDMode.Predictable; + radio.Value = e.Row.Cells[1].Text; + radio.Attributes.Add("onclick", "selected(this.id);"); + e.Row.Cells[0].Controls.Add(radio); + } + else if(e.Row.RowType == DataControlRowType.Header) + { + for(int i = 0; i < e.Row.Cells.Count; i++) + { + string cellText = e.Row.Cells[i].Text; + + cellText = MixERP.Net.Common.Helpers.LocalizationHelper.GetResourceString("FormResource", cellText); + e.Row.Cells[i].Text = cellText; + } + } + } + + protected void CancelButton_Click(object sender, EventArgs e) + { + //Clear the form. + this.FormContainer.Controls.Clear(); + + //Clear grid selection. + this.ClearSelectedValue(); + + //Load the form again. + using(System.Data.DataTable table = new System.Data.DataTable()) + { + table.Locale = System.Threading.Thread.CurrentThread.CurrentCulture; + this.LoadForm(this.FormContainer, table); + } + } + + protected void EditButton_Click(object sender, EventArgs e) + { + string id = this.GetSelectedValue(); + if(string.IsNullOrWhiteSpace(id)) + { + return; + } + + using(System.Data.DataTable table = MixERP.Net.BusinessLayer.Helpers.FormHelper.GetTable(this.TableSchema, this.Table, this.KeyColumn, id)) + { + if(table.Rows.Count.Equals(1)) + { + //Clear the form container. + FormContainer.Controls.Clear(); + + //Load the form again in the container with values + //retrieved from database. + this.LoadForm(this.FormContainer, table); + GridPanel.Attributes["style"] = "display:none;"; + FormPanel.Attributes["style"] = "display:block;"; + } + } + } + + protected void DeleteButton_Click(object sender, EventArgs e) + { + string id = this.GetSelectedValue(); + if(string.IsNullOrWhiteSpace(id)) + { + return; + } + + if(DenyDelete) + { + FormLabel.CssClass = "failure"; + FormLabel.Text = Resources.Warnings.AccessDenied; + return; + } + + if(MixERP.Net.BusinessLayer.Helpers.FormHelper.DeleteRecord(this.TableSchema, this.Table, this.KeyColumn, id)) + { + //Refresh the grid. + this.BindGridView(); + + this.DisplaySuccess(); + } + + } + + protected void SaveButton_Click(object sender, EventArgs e) + { + this.Page.Validate(); + + if(!this.Page.IsValid) + { + return; + } + + System.Collections.ObjectModel.Collection> list = this.GetFormCollection(true); + string id = this.GetSelectedValue(); + + if(string.IsNullOrWhiteSpace(id)) + { + if(DenyAdd) + { + FormLabel.CssClass = "failure"; + FormLabel.Text = Resources.Warnings.AccessDenied; + } + else + { + if(MixERP.Net.BusinessLayer.Helpers.FormHelper.InsertRecord(this.TableSchema, this.Table, list, this.imageColumn)) + { + //Clear the form container. + FormContainer.Controls.Clear(); + + //Load the form again. + this.LoadForm(this.FormContainer, new System.Data.DataTable()); + + //Refresh the grid. + this.BindGridView(); + + this.DisplaySuccess(); + + } + } + } + else + { + if(DenyEdit) + { + FormLabel.CssClass = "failure"; + FormLabel.Text = Resources.Warnings.AccessDenied; + } + else + { + if(MixERP.Net.BusinessLayer.Helpers.FormHelper.UpdateRecord(this.TableSchema, this.Table, list, this.KeyColumn, id, this.imageColumn)) + { + //Clear the form container. + FormContainer.Controls.Clear(); + + //Load the form again. + using(System.Data.DataTable table = new System.Data.DataTable()) + { + table.Locale = System.Threading.Thread.CurrentThread.CurrentCulture; + + this.LoadForm(this.FormContainer, table); + } + + //Refresh the grid. + this.BindGridView(); + + this.DisplaySuccess(); + } + else + { + FormLabel.CssClass = "failure"; + FormLabel.Text = Resources.Warnings.UnknownError; + } + } + } + } + + #endregion + + private void ClearSelectedValue() + { + foreach(GridViewRow row in FormGridView.Rows) + { + HtmlInputRadioButton r = (HtmlInputRadioButton)row.Controls[0].Controls[0]; + if(r.Checked) + { + r.Checked = false; + } + } + } + + private string GetSelectedValue() + { + foreach(GridViewRow row in FormGridView.Rows) + { + HtmlInputRadioButton r = (HtmlInputRadioButton)row.Controls[0].Controls[0]; + if(r.Checked) + { + return r.Value; + } + } + + return string.Empty; + } + + private void LoadGrid() + { + bool showAll = (MixERP.Net.Common.Conversion.TryCastString(Request.QueryString["show"]).Equals("all")); + + this.BindGridView(); + this.FormGridView.Width = this.Width; + this.Pager.RecordCount = MixERP.Net.BusinessLayer.Helpers.FormHelper.GetTotalRecords(this.ViewSchema, this.View); + this.Pager.PageSize = 10; + + + if(this.PageSize != 0) + { + this.Pager.PageSize = this.PageSize; + } + + if(showAll) + { + this.Pager.PageSize = 1000; + } + + + this.UserIdHidden.Value = MixERP.Net.BusinessLayer.Helpers.SessionHelper.UserName(); + this.OfficeCodeHidden.Value = MixERP.Net.BusinessLayer.Helpers.SessionHelper.OfficeName(); + } + + private void BindGridView() + { + bool showAll = (MixERP.Net.Common.Conversion.TryCastString(Request.QueryString["show"]).Equals("all")); + + int limit = 10; + int offset = 0; + + if(this.PageSize != 0) + { + limit = this.PageSize; + } + + if(showAll) + { + limit = 1000; + } + + if(this.Page.Request["page"] != null) + { + offset = (MixERP.Net.Common.Conversion.TryCastInteger(this.Page.Request["page"]) - 1) * limit; + } + + + using(System.Data.DataTable table = MixERP.Net.BusinessLayer.Helpers.FormHelper.GetView(this.ViewSchema, this.View, this.KeyColumn, limit, offset)) + { + this.FormGridView.DataSource = table; + this.FormGridView.DataBind(); + } + } + + + private void LoadForm(Panel container, System.Data.DataTable values) + { + HtmlTable t = new HtmlTable(); + t.Attributes["class"] = "valignmiddle"; + + using(System.Data.DataTable table = MixERP.Net.BusinessLayer.Helpers.TableHelper.GetTable(this.TableSchema, this.Table, this.Exclude)) + { + if(table.Rows.Count > 0) + { + foreach(System.Data.DataRow row in table.Rows) + { + string columnName = MixERP.Net.Common.Conversion.TryCastString(row["column_name"]); + string defaultValue = MixERP.Net.Common.Conversion.TryCastString(row["column_default"]); //nextval('%_seq'::regclass) + bool isSerial = defaultValue.StartsWith("nextval", StringComparison.OrdinalIgnoreCase); + bool isNullable = MixERP.Net.Common.Conversion.TryCastBoolean(row["is_nullable"]); + string dataType = MixERP.Net.Common.Conversion.TryCastString(row["data_type"]); + string domain = MixERP.Net.Common.Conversion.TryCastString(row["domain_name"]); + int maxLength = MixERP.Net.Common.Conversion.TryCastInteger(row["character_maximum_length"]); + + string parentTableSchema = MixERP.Net.Common.Conversion.TryCastString(row["references_schema"]); + string parentTable = MixERP.Net.Common.Conversion.TryCastString(row["references_table"]); + string parentTableColumn = MixERP.Net.Common.Conversion.TryCastString(row["references_field"]); + + if(values.Rows.Count.Equals(1)) + { + defaultValue = MixERP.Net.Common.Conversion.TryCastString(values.Rows[0][columnName]); + } + + this.AddField(t, columnName, defaultValue, isSerial, isNullable, dataType, domain, maxLength, parentTableSchema, parentTable, parentTableColumn); + } + } + } + + container.Controls.Add(t); + } + + private void DisplaySuccess() + { + FormLabel.CssClass = "success"; + FormLabel.Text = Resources.Labels.TaskCompletedSuccessfully; + + GridPanel.Attributes["style"] = "display:block;"; + FormPanel.Attributes["style"] = "display:none;"; + MixERP.Net.Common.PageUtility.ExecuteJavaScript("resetForm", "$('#form1').each(function(){this.reset();});", this.Page); + } + + #region Form Generator + /// + /// This function iterates through all the dynamically added controls, checks their values, and returns a list of column and values mapped as KeyValuePair<column_name, value>. + /// + /// Skip the PostgreSQL serial column. There is no need to explicity set the value for the serial column. This value should be true if you are obtaining the form to insert the record. Set this paramter to false if you want to update the form based on the serial's columns value. + /// Returns a list of column and values mapped as KeyValuePair<column_name, value> + private System.Collections.ObjectModel.Collection> GetFormCollection(bool skipSerial) + { + System.Collections.ObjectModel.Collection> list = new System.Collections.ObjectModel.Collection>(); + + using(System.Data.DataTable table = MixERP.Net.BusinessLayer.Helpers.TableHelper.GetTable(this.TableSchema, this.Table, this.Exclude)) + { + if(table.Rows.Count > 0) + { + foreach(System.Data.DataRow row in table.Rows) + { + string columnName = MixERP.Net.Common.Conversion.TryCastString(row["column_name"]); + string defaultValue = MixERP.Net.Common.Conversion.TryCastString(row["column_default"]); + bool isSerial = defaultValue.StartsWith("nextval", StringComparison.OrdinalIgnoreCase); + string parentTableColumn = MixERP.Net.Common.Conversion.TryCastString(row["references_field"]); + string dataType = MixERP.Net.Common.Conversion.TryCastString(row["data_type"]); + + if(skipSerial) + { + if(isSerial) + { + continue; + } + } + + if(string.IsNullOrWhiteSpace(parentTableColumn)) + { + switch(dataType) + { + case "national character varying": + case "character varying": + case "national character": + case "character": + case "char": + case "varchar": + case "nvarchar": + case "text": + case "date": + case "smallint": + case "integer": + case "bigint": + case "numeric": + case "money": + case "double": + case "double precision": + case "float": + case "real": + case "currency": + //TextBox + TextBox t = (TextBox)FormContainer.FindControl(columnName + "_textbox"); + if(t != null) + { + list.Add(new KeyValuePair(columnName, t.Text)); + } + break; + case "boolean": + RadioButtonList r = (RadioButtonList)FormContainer.FindControl(columnName + "_radiobuttonlist"); + list.Add(new KeyValuePair(columnName, r.Text)); + break; + case "bytea": + FileUpload f = (FileUpload)FormContainer.FindControl(columnName + "_fileupload"); + string file = this.UploadFile(f); + list.Add(new KeyValuePair(columnName, file)); + imageColumn = columnName; + break; + } + + } + else + { + //DropDownList + DropDownList d = (DropDownList)FormContainer.FindControl(columnName + "_dropdownlist"); + list.Add(new KeyValuePair(columnName, d.Text)); + } + } + } + } + + return list; + } + + + private string UploadFile(FileUpload fileUpload) + { + string uploadDirectory = Server.MapPath("~/Media/Temp"); + if(!System.IO.Directory.Exists(uploadDirectory)) + { + System.IO.Directory.CreateDirectory(uploadDirectory); + } + + string id = Guid.NewGuid().ToString(); + + if(fileUpload.HasFile) + { + id += System.IO.Path.GetExtension(fileUpload.FileName); + id = System.IO.Path.Combine(uploadDirectory, id); + + fileUpload.SaveAs(id); + } + + return id; + } + + private void AddRow(HtmlTable table, string label, params Control[] controls) + { + HtmlTableRow newRow = new HtmlTableRow(); + HtmlTableCell labelCell = new HtmlTableCell(); + HtmlTableCell controlCell = new HtmlTableCell(); + Literal labelLiteral = new Literal(); + + labelLiteral.Text = string.Format(System.Threading.Thread.CurrentThread.CurrentCulture, "", controls[0].ID, label); + labelCell.Attributes.Add("class", "label-cell"); + + labelCell.Controls.Add(labelLiteral); + + foreach(Control control in controls) + { + if(control != null) + { + controlCell.Controls.Add(control); + } + } + + newRow.Cells.Add(labelCell); + newRow.Cells.Add(controlCell); + table.Rows.Add(newRow); + } + + private void AddField(HtmlTable t, string columnName, string defaultValue, bool isSerial, bool isNullable, string dataType, string domain, int maxLength, string parentTableSchema, string parentTable, string parentTableColumn) + { + if(string.IsNullOrWhiteSpace(parentTableColumn)) + { + switch(dataType) + { + case "national character varying": + case "character varying": + case "national character": + case "character": + case "char": + case "varchar": + case "nvarchar": + case "text": + this.AddTextBox(t, columnName, defaultValue, isNullable, maxLength); + break; + case "smallint": + case "integer": + case "bigint": + this.AddNumberTextBox(t, columnName, defaultValue, isSerial, isNullable, maxLength, domain); + break; + case "numeric": + case "money": + case "double": + case "double precision": + case "float": + case "real": + case "currency": + this.AddDecimalTextBox(t, columnName, defaultValue, isNullable, maxLength, domain); + break; + case "boolean": + this.AddRadioButtonList(t, columnName, isNullable, Resources.Titles.YesNo, "true,false", defaultValue); + break; + case "date": + this.AddDateTextBox(t, columnName, defaultValue, isNullable, maxLength); + break; + case "bytea": + this.AddFileUpload(t, columnName, isNullable); + break; + case "timestamp with time zone": + //Do not show this field + break; + } + } + else + { + this.AddDropDownList(t, columnName, isNullable, parentTableSchema, parentTable, parentTableColumn, defaultValue); + } + } + #endregion + + #region Add Controls + private void AddDropDownList(HtmlTable t, string columnName, bool isNullable, string tableSchema, string tableName, string tableColumn, string defaultValue) + { + string selectedItemValue = string.Empty; + string dataTextField = string.Empty; + string relation = string.Empty; + string viewRelation = string.Empty; + string selected = string.Empty; + string label = MixERP.Net.Common.Helpers.LocalizationHelper.GetResourceString("FormResource", columnName); + string schema = string.Empty; + string view = string.Empty; + HtmlAnchor itemSelectorAnchor = null; + + DropDownList dropDownList = this.GetDropDownList(columnName + "_dropdownlist"); + + + using(System.Data.DataTable table = MixERP.Net.BusinessLayer.Helpers.FormHelper.GetTable(tableSchema, tableName)) + { + if(table.Rows.Count > 0) + { + //See DisplayFields Property for more information. + //Loop through all the DisplayFields to match this control. + foreach(string displayField in this.DisplayFields.Split(',')) + { + //First, trim the field to remove whitespaces. + viewRelation = displayField.Trim(); + + //The fully qualified name of this column. + relation = tableSchema + "." + tableName + "." + tableColumn; + + //Check whether this field matches exactly with this column. + if(viewRelation.StartsWith(relation, StringComparison.OrdinalIgnoreCase)) + { + //This field in this loop contained the column name we were looking for. + //Now, get the mapped column (display field) to show on the drop down list. + //This should be done by : + //1. Removing the column name from the field. + //2. Removign the the "-->" symbol. + //What we get is the name of the field that is displayed on this drop down list. + dataTextField = viewRelation.Replace(relation + "-->", ""); + + //Since we have found the field we needed, let's break this loop. + break; + } + //Probably this was not the field we were looking for. + } + + //The display field can be an existing column or a representation of different columns (formula). + //Let's check whether the display field really exists. + if(!table.Columns.Contains(dataTextField)) + { + //This display field was a formula based various columns. + //Now, we are adding a new column "DataTextField" in the data table using the requested formula. + table.Columns.Add("DataTextField", typeof(string), dataTextField); + dataTextField = "DataTextField"; + } + + dropDownList.DataSource = table; + dropDownList.DataValueField = tableColumn; + dropDownList.DataTextField = dataTextField; + dropDownList.DataBind(); + + if(!string.IsNullOrWhiteSpace(this.DisplayViews)) + { + //See DisplayViews Property for more information. + //Loop through all the DisplayViews to match this control. + foreach(string displayView in this.DisplayViews.Split(',')) + { + //First, trim the field to remove whitespaces. + viewRelation = displayView.Trim(); + + //The fully qualified name of this column. + relation = tableSchema + "." + tableName + "." + tableColumn; + + //Check whether this view matches exactly with this column. + if(viewRelation.StartsWith(relation, StringComparison.OrdinalIgnoreCase)) + { + //This view in this loop starts with the column name we were looking for. + //Now, get the mapped view to show on the modal page. + //This should be done by : + //1. Removing the column name from the field. + //2. Removign the the "-->" symbol. + //What we get is the name of the view that is shown on the modal page. + viewRelation = viewRelation.Replace(relation + "-->", ""); + + //Since we have found the field we needed, let's break this loop. + break; + } + //Probably this was not the field we were looking for. + } + + schema = viewRelation.Split('.').First(); + view = viewRelation.Split('.').Last(); + + //Sanitize the schema and the view + schema = MixERP.Net.BusinessLayer.DBFactory.Sanitizer.SanitizeIdentifierName(schema); + view = MixERP.Net.BusinessLayer.DBFactory.Sanitizer.SanitizeIdentifierName(view); + + if(string.IsNullOrWhiteSpace(schema) || string.IsNullOrWhiteSpace(view)) + { + schema = string.Empty; + view = string.Empty; + } + else + { + itemSelectorAnchor = new HtmlAnchor(); + itemSelectorAnchor.Attributes["class"] = "item-selector"; + itemSelectorAnchor.HRef = "/General/ItemSelector.aspx?Schema=" + schema + "&View=" + view + "&AssociatedControlId=" + dropDownList.ID; + } + } + + } + } + + + //Determining the value which will be pre-selected when this drop down list is displayed. + + //If the "defaultValue" parameter has a value, it means that the form is being edited. + //Check if "defaultValue" is empty. + if(!string.IsNullOrWhiteSpace(defaultValue)) + { + selectedItemValue = defaultValue; + } + else + { + //In this case, this is probably a fresh form for entry. + //Checking if the "SelectedValues" has a value. + if(!string.IsNullOrWhiteSpace(this.SelectedValues)) + { + foreach(string selectedValue in this.SelectedValues.Split(',')) + { + //Trim whitespaces + selected = selectedValue.Trim(); + + //The plain old fully qualified name of this column. + relation = tableSchema + "." + tableName + "." + tableColumn; + + //Checking again whether this field matches exactly with this column. + if(selected.StartsWith(relation, StringComparison.OrdinalIgnoreCase)) + { + //This field in this loop contained the column name we were looking for. + //Now, get the mapped column (display field) to show on the drop down list. + //This should be done by : + //1. Removing the column name from the field. + //2. Removign the the "-->" symbol. + string value = selected.Replace(relation + "-->", ""); + + //Check the type of the value. + //If the value starts with single inverted comma, the value is a text. + if(value.StartsWith("'", StringComparison.OrdinalIgnoreCase)) + { + //The selected item value from the drop down list text fields. + ListItem item = dropDownList.Items.FindByText(value.Replace("'", "")); + + if(item != null) + { + selectedItemValue = item.Value; + } + } + else + { + selectedItemValue = value; + } + break; + } + } + } + } + + + if(!string.IsNullOrWhiteSpace(selectedItemValue)) + { + dropDownList.SelectedValue = selectedItemValue; + } + + + if(isNullable) + { + dropDownList.Items.Insert(0, new ListItem(String.Empty, String.Empty)); + AddRow(t, label, dropDownList, itemSelectorAnchor); + } + else + { + RequiredFieldValidator required = GetRequiredFieldValidator(dropDownList); + AddRow(t, label + Resources.Setup.RequiredFieldIndicator, dropDownList, required, itemSelectorAnchor); + } + + } + + private void AddRadioButtonList(HtmlTable t, string columnName, bool isNullable, string keys, string values, string selectedValue) + { + RadioButtonList radioButtonList = this.GetRadioButtonList(columnName + "_radiobuttonlist", keys, values, selectedValue); + string label = MixERP.Net.Common.Helpers.LocalizationHelper.GetResourceString("FormResource", columnName); + + if(!isNullable) + { + RequiredFieldValidator required = GetRequiredFieldValidator(radioButtonList); + AddRow(t, label + Resources.Setup.RequiredFieldIndicator, radioButtonList, required); + return; + } + + AddRow(t, label, radioButtonList); + } + + private void AddCheckBoxList(HtmlTable t, string columnName, bool isNullable, string keys, string values, string selectedValues) + { + CheckBoxList checkBoxList = this.GetCheckBoxList(columnName + "_radiobuttonlist", keys, values, selectedValues); + string label = MixERP.Net.Common.Helpers.LocalizationHelper.GetResourceString("FormResource", columnName); + + if(!isNullable) + { + RequiredFieldValidator required = GetRequiredFieldValidator(checkBoxList); + AddRow(t, label + Resources.Setup.RequiredFieldIndicator, checkBoxList, required); + return; + } + + AddRow(t, label, checkBoxList); + } + + private void AddListItems(ListControl control, string keys, string values, string selectedValues) + { + string[] key = keys.Split(','); + string[] value = values.Split(','); + + if(key.Count() == value.Count()) + { + for(int i = 0; i < key.Length; i++) + { + ListItem item = new ListItem(key[i].Trim(), value[i].Trim()); + control.Items.Add(item); + } + } + + foreach(ListItem item in control.Items) + { + if(control is CheckBoxList) + { + foreach(string selectedValue in selectedValues.Split(',')) + { + if(item.Value.Trim().Equals(selectedValue.Trim())) + { + item.Selected = true; + } + } + } + else + { + if(item.Value.Trim().Equals(selectedValues.Split(',').Last().Trim())) + { + item.Selected = true; + break; + } + } + } + } + + private void AddNumberTextBox(HtmlTable t, string columnName, string defaultValue, bool isSerial, bool isNullable, int maxLength, string domain) + { + TextBox textBox = this.GetNumberTextBox(columnName + "_textbox", maxLength); + string label = MixERP.Net.Common.Helpers.LocalizationHelper.GetResourceString("FormResource", columnName); + + if(!defaultValue.StartsWith("nextVal", StringComparison.OrdinalIgnoreCase)) + { + textBox.Text = defaultValue; + } + + textBox.Width = 200; + + if(isSerial) + { + textBox.ReadOnly = true; + } + else + { + if(!isNullable) + { + CompareValidator validator = this.GetNumericalValidator(textBox, domain); + RequiredFieldValidator required = GetRequiredFieldValidator(textBox); + AddRow(t, label + Resources.Setup.RequiredFieldIndicator, textBox, validator, required); + return; + } + } + + AddRow(t, label, textBox); + } + + private void AddDecimalTextBox(HtmlTable t, string columnName, string defaultValue, bool isNullable, int maxLength, string domain) + { + TextBox textBox = this.GetTextBox(columnName + "_textbox", maxLength); + string label = MixERP.Net.Common.Helpers.LocalizationHelper.GetResourceString("FormResource", columnName); + + CompareValidator validator = this.GetDecimalValidator(textBox, domain); + textBox.Text = defaultValue; + + if(!isNullable) + { + RequiredFieldValidator required = GetRequiredFieldValidator(textBox); + AddRow(t, label + Resources.Setup.RequiredFieldIndicator, textBox, validator, required); + return; + } + + AddRow(t, label, textBox, validator); + } + + private void AddDateTextBox(HtmlTable t, string columnName, string defaultValue, bool isNullable, int maxLength) + { + string label = MixERP.Net.Common.Helpers.LocalizationHelper.GetResourceString("FormResource", columnName); + + TextBox textBox = this.GetTextBox(columnName + "_textbox", maxLength); + textBox.CssClass = "date"; + + CompareValidator validator = this.GetDateValidator(textBox); + AjaxControlToolkit.CalendarExtender extender = new AjaxControlToolkit.CalendarExtender(); + + textBox.Width = 70; + extender.ID = textBox.ID + "_calendar_extender"; + extender.TargetControlID = textBox.ID; + extender.PopupButtonID = textBox.ID; + + if(!string.IsNullOrWhiteSpace(defaultValue)) + { + textBox.Text = MixERP.Net.Common.Conversion.TryCastDate(defaultValue).ToShortDateString(); + } + + + if(!isNullable) + { + RequiredFieldValidator required = GetRequiredFieldValidator(textBox); + AddRow(t, label + Resources.Setup.RequiredFieldIndicator, textBox, validator, required, extender); + return; + } + + AddRow(t, label, textBox, validator, extender); + } + + private void AddTextBox(HtmlTable t, string columnName, string defaultValue, bool isNullable, int maxLength) + { + TextBox textBox = this.GetTextBox(columnName + "_textbox", maxLength); + string label = MixERP.Net.Common.Helpers.LocalizationHelper.GetResourceString("FormResource", columnName); + + textBox.Text = defaultValue; + + if(!isNullable) + { + RequiredFieldValidator required = GetRequiredFieldValidator(textBox); + AddRow(t, label + Resources.Setup.RequiredFieldIndicator, textBox, required); + return; + } + + AddRow(t, label, textBox); + } + + private void AddFileUpload(HtmlTable t, string columnName, bool isNullable) + { + string label = MixERP.Net.Common.Helpers.LocalizationHelper.GetResourceString("FormResource", columnName); + FileUpload fileUpload = this.GetFileUpload(columnName + "_fileupload"); + RegularExpressionValidator validator = this.GetImageValidator(fileUpload); + + UpdatePanel1.Triggers.Clear(); + ScriptManager.GetCurrent(this.Page).RegisterPostBackControl(SaveButton); + + if(!isNullable) + { + RequiredFieldValidator required = GetRequiredFieldValidator(fileUpload); + + AddRow(t, label + Resources.Setup.RequiredFieldIndicator, fileUpload, required, validator); + return; + } + + AddRow(t, label, fileUpload, validator); + } + #endregion + + #region Get Controls + private FileUpload GetFileUpload(string id) + { + FileUpload fileUpload = new FileUpload(); + fileUpload.ID = id; + + return fileUpload; + } + + private CheckBoxList GetCheckBoxList(string id, string keys, string values, string selectedValues) + { + CheckBoxList list = new CheckBoxList(); + list.ID = id; + list.ClientIDMode = System.Web.UI.ClientIDMode.Static; + + list.RepeatDirection = RepeatDirection.Horizontal; + AddListItems(list, keys, values, selectedValues); + return list; + } + + private RadioButtonList GetRadioButtonList(string id, string keys, string values, string selectedValues) + { + RadioButtonList list = new RadioButtonList(); + list.ID = id; + list.ClientIDMode = System.Web.UI.ClientIDMode.Static; + + list.RepeatDirection = RepeatDirection.Horizontal; + AddListItems(list, keys, values, selectedValues); + return list; + } + + private DropDownList GetDropDownList(string id, string keys, string values, string selectedValues) + { + DropDownList list = new DropDownList(); + list.ID = id; + list.ClientIDMode = System.Web.UI.ClientIDMode.Static; + + AddListItems(list, keys, values, selectedValues); + return list; + } + + private DropDownList GetDropDownList(string id) + { + DropDownList dropDownList = new DropDownList(); + dropDownList.ID = id; + + dropDownList.ClientIDMode = System.Web.UI.ClientIDMode.Static; + + return dropDownList; + } + + private TextBox GetTextBox(string id, int maxLength) + { + TextBox textBox = new TextBox(); + textBox.ID = id; + + if(maxLength > 0) + { + textBox.MaxLength = maxLength; + } + + textBox.ClientIDMode = System.Web.UI.ClientIDMode.Static; + + return textBox; + } + + private TextBox GetNumberTextBox(string id, int maxLength) + { + TextBox textBox = this.GetTextBox(id, maxLength); + textBox.Attributes["type"] = "number"; + return textBox; + } + + private TextBox GetDateTextBox(string id, int maxLength) + { + TextBox textBox = this.GetTextBox(id, maxLength); + textBox.Attributes["type"] = "date"; + return textBox; + } + #endregion + + #region Get Validators + private CompareValidator GetDateValidator(Control controlToValidate) + { + CompareValidator validator = new CompareValidator(); + validator.ID = controlToValidate.ID + "DateValidator"; + validator.ErrorMessage = "
    " + Resources.Warnings.InvalidDate; + validator.CssClass = "form-error"; + validator.ControlToValidate = controlToValidate.ID; + validator.EnableClientScript = true; + validator.SetFocusOnError = true; + validator.Display = ValidatorDisplay.Dynamic; + validator.Type = ValidationDataType.Date; + validator.Operator = ValidationCompareOperator.GreaterThan; + validator.ValueToCompare = "1-1-1900"; + + return validator; + } + + private CompareValidator GetDecimalValidator(Control controlToValidate, string domain) + { + CompareValidator validator = new CompareValidator(); + validator.ID = controlToValidate.ID + "DecimalValidator"; + validator.ErrorMessage = "
    " + Resources.Warnings.OnlyNumbersAllowed; + validator.CssClass = "form-error"; + validator.ControlToValidate = controlToValidate.ID; + validator.EnableClientScript = true; + validator.SetFocusOnError = true; + validator.Display = ValidatorDisplay.Dynamic; + validator.Type = ValidationDataType.Double; + + //MixERP strict data type + if(domain.Contains("strict")) + { + validator.Operator = ValidationCompareOperator.GreaterThan; + } + else + { + validator.Operator = ValidationCompareOperator.GreaterThanEqual; + } + + validator.ValueToCompare = "0"; + + return validator; + } + + private CompareValidator GetNumericalValidator(Control controlToValidate, string domain) + { + CompareValidator validator = new CompareValidator(); + validator.ID = controlToValidate.ID + "NumberValidator"; + validator.ErrorMessage = "
    " + Resources.Warnings.OnlyNumbersAllowed; + validator.CssClass = "form-error"; + validator.ControlToValidate = controlToValidate.ID; + validator.EnableClientScript = true; + validator.SetFocusOnError = true; + validator.Display = ValidatorDisplay.Dynamic; + validator.Type = ValidationDataType.Integer; + + //MixERP strict data type + if(domain.Contains("strict")) + { + validator.Operator = ValidationCompareOperator.GreaterThan; + } + else + { + validator.Operator = ValidationCompareOperator.GreaterThanEqual; + } + + validator.ValueToCompare = "0"; + + return validator; + } + + private RequiredFieldValidator GetRequiredFieldValidator(Control controlToValidate) + { + RequiredFieldValidator validator = new RequiredFieldValidator(); + validator.ID = controlToValidate.ID + "RequiredValidator"; + validator.ErrorMessage = "
    " + Resources.Warnings.RequiredField; + validator.CssClass = "form-error"; + validator.ControlToValidate = controlToValidate.ID; + validator.EnableClientScript = true; + validator.SetFocusOnError = true; + validator.Display = ValidatorDisplay.Dynamic; + + return validator; + } + + private RegularExpressionValidator GetImageValidator(Control controlToValidate) + { + RegularExpressionValidator validator = new RegularExpressionValidator(); + validator.ID = controlToValidate.ID + "RegexValidator"; + validator.ErrorMessage = "
    " + Resources.Warnings.InvalidImage; + validator.CssClass = "form-error"; + validator.ControlToValidate = controlToValidate.ID; + validator.EnableClientScript = true; + validator.SetFocusOnError = true; + validator.Display = ValidatorDisplay.Dynamic; + validator.ValidationExpression = @"(.*\.([gG][iI][fF]|[jJ][pP][gG]|[jJ][pP][eE][gG]|[bB][mM][pP])$)"; + return validator; + } + #endregion + + } +} \ No newline at end of file diff --git a/MixERP.Net.FrontEnd/UserControls/Forms/FormControl.ascx.designer.cs b/MixERP.Net.FrontEnd/UserControls/Forms/FormControl.ascx.designer.cs new file mode 100644 index 000000000..fdb57f24b --- /dev/null +++ b/MixERP.Net.FrontEnd/UserControls/Forms/FormControl.ascx.designer.cs @@ -0,0 +1,276 @@ +//------------------------------------------------------------------------------ +// +// 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.Forms { + + + public partial class FormControl { + + /// + /// ScriptManager1 control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::AjaxControlToolkit.ToolkitScriptManager ScriptManager1; + + /// + /// updProgress control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.UpdateProgress updProgress; + + /// + /// 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; + + /// + /// DescriptionLabel control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Label DescriptionLabel; + + /// + /// UpdatePanel1 control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.UpdatePanel UpdatePanel1; + + /// + /// ShowCompactButton control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Button ShowCompactButton; + + /// + /// ShowAllButton control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Button ShowAllButton; + + /// + /// 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; + + /// + /// EditButton control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Button EditButton; + + /// + /// DeleteButton control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Button DeleteButton; + + /// + /// PrintButton control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Button PrintButton; + + /// + /// FormLabel control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Label FormLabel; + + /// + /// 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; + + /// + /// FormGridView control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.GridView FormGridView; + + /// + /// Pager control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::Wuqi.Webdiyer.AspNetPager Pager; + + /// + /// FormPanel control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Panel FormPanel; + + /// + /// AddNewEntryLiteral control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Literal AddNewEntryLiteral; + + /// + /// RequiredFieldDetailsLiteral control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Literal RequiredFieldDetailsLiteral; + + /// + /// FormContainer control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Panel FormContainer; + + /// + /// 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; + + /// + /// CancelButton control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Button CancelButton; + + /// + /// ShowCompactButton2 control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Button ShowCompactButton2; + + /// + /// ShowAllButton2 control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Button ShowAllButton2; + + /// + /// AddButton2 control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Button AddButton2; + + /// + /// EditButton2 control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Button EditButton2; + + /// + /// DeleteButton2 control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Button DeleteButton2; + + /// + /// PrintButton2 control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Button PrintButton2; + + /// + /// UserIdHidden control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.HiddenField UserIdHidden; + + /// + /// OfficeCodeHidden control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.HiddenField OfficeCodeHidden; + } +} diff --git a/MixERP.Net.FrontEnd/UserControls/Products/ProductControl.ascx b/MixERP.Net.FrontEnd/UserControls/Products/ProductControl.ascx new file mode 100644 index 000000000..9d216a5d0 --- /dev/null +++ b/MixERP.Net.FrontEnd/UserControls/Products/ProductControl.ascx @@ -0,0 +1,463 @@ +<%-- +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="ProductControl.ascx.cs" Inherits="MixERP.Net.FrontEnd.UserControls.Products.ProductControl" %> + +
    + + + +
    + progress +
    +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + + + + + + + + + + + +
    + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +
    +
    + + + + + + + + + + + +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + + + + +
    + + + + + + + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +   + + +

    + +

    + +
    +
    +
    +
    + diff --git a/MixERP.Net.FrontEnd/UserControls/Products/ProductControl.ascx.cs b/MixERP.Net.FrontEnd/UserControls/Products/ProductControl.ascx.cs new file mode 100644 index 000000000..14912ace8 --- /dev/null +++ b/MixERP.Net.FrontEnd/UserControls/Products/ProductControl.ascx.cs @@ -0,0 +1,785 @@ +/******************************************************************************** +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.Globalization; +using System.Linq; +using System.Threading; +using System.Web; +using System.Web.UI; +using System.Web.UI.WebControls; +using Microsoft.VisualBasic; + +namespace MixERP.Net.FrontEnd.UserControls.Products +{ + public partial class ProductControl : System.Web.UI.UserControl + { + public enum TranType { Sales, Purchase } + public TranType TransactionType { get; set; } + public enum SubTranType { Direct, Quotation, Order, /*Readonly*/ Delivery,/*Readonly*/ Receipt, /*Readonly*/ Invoice } + public SubTranType SubType { get; set; } + public string Text { get; set; } + public GridView Grid { get { return ProductGridView; } } + public bool DisplayTransactionTypeRadioButtonList { get; set; } + public bool VerifyStock { get; set; } + public bool ShowCashRepository { get; set; } + + public ControlCollection GetForm + { + get + { + return this.GetControls(); + } + } + + public class ControlCollection + { + public MixERP.Net.FrontEnd.UserControls.DateTextBox DateTextBox { get; set; } + public DropDownList StoreDropDownList { get; set; } + public RadioButtonList TransactionTypeRadioButtonList { get; set; } + public TextBox PartyCodeTextBox { get; set; } + public DropDownList PartyDropDownList { get; set; } + public DropDownList PriceTypeDropDownList { get; set; } + public TextBox ReferenceNumberTextBox { get; set; } + public GridView Grid { get; set; } + public TextBox RunningTotalTextBox { get; set; } + public TextBox TaxTotalTextBox { get; set; } + public TextBox GrandTotalTextBox { get; set; } + public DropDownList ShippingAddressDropDownList { get; set; } + public DropDownList ShippingCompanyDropDownList { get; set; } + public TextBox ShippingChargeTextBox { get; set; } + public DropDownList CashRepositoryDropDownList { get; set; } + public TextBox CashRepositoryBalanceTextBox { get; set; } + public DropDownList CostCenterDropDownList { get; set; } + public DropDownList AgentDropDownList { get; set; } + public TextBox StatementReferenceTextBox { get; set; } + } + + private ControlCollection GetControls() + { + ControlCollection collection = new ControlCollection(); + collection.DateTextBox = this.DateTextBox; + collection.StoreDropDownList = this.StoreDropDownList; + collection.TransactionTypeRadioButtonList = this.TransactionTypeRadioButtonList; + collection.PartyCodeTextBox = this.PartyCodeTextBox; + collection.PartyDropDownList = this.PartyDropDownList; + collection.PriceTypeDropDownList = this.PriceTypeDropDownList; + collection.ReferenceNumberTextBox = this.ReferenceNumberTextBox; + collection.Grid = this.ProductGridView; + collection.RunningTotalTextBox = this.RunningTotalTextBox; + collection.TaxTotalTextBox = this.TaxTotalTextBox; + collection.GrandTotalTextBox = this.GrandTotalTextBox; + collection.ShippingAddressDropDownList = this.ShippingAddressDropDownList; + collection.ShippingCompanyDropDownList = this.ShippingCompanyDropDownList; + collection.ShippingChargeTextBox = this.ShippingChargeTextBox; + collection.CashRepositoryDropDownList = this.CashRepositoryDropDownList; + collection.CashRepositoryBalanceTextBox = this.CashRepositoryBalanceTextBox; + collection.CostCenterDropDownList = this.CostCenterDropDownList; + collection.AgentDropDownList = this.SalesPersonDropDownList; + collection.StatementReferenceTextBox = this.StatementReferenceTextBox; + return collection; + } + + + public Unit TopPanelWidth + { + get + { + return this.TopPanel.Width; + } + set + { + this.TopPanel.Width = value; + } + + } + + public event EventHandler SaveButtonClick; + + public virtual void OnSaveButtonClick(object sender, EventArgs e) + { + if(SaveButtonClick != null) + { + this.SaveButtonClick(sender, e); + } + } + + protected void SaveButton_Click(object sender, EventArgs e) + { + //Validation Check Start + if(ProductGridView.Rows.Count.Equals(0)) + { + ErrorLabel.Text = Resources.Warnings.NoItemFound; + return; + } + + if(this.TransactionType == TranType.Purchase && CashRepositoryRow.Visible) + { + this.UpdateRepositoryBalance(); + + decimal repositoryBalance = MixERP.Net.Common.Conversion.TryCastDecimal(CashRepositoryBalanceTextBox.Text); + decimal grandTotal = MixERP.Net.Common.Conversion.TryCastDecimal(GrandTotalTextBox.Text); + + if(grandTotal > repositoryBalance) + { + ErrorLabel.Text = Resources.Warnings.NotEnoughCash; + return; + } + } + + if(!string.IsNullOrWhiteSpace(ShippingChargeTextBox.Text)) + { + if(!Information.IsNumeric(ShippingChargeTextBox.Text)) + { + MixERP.Net.BusinessLayer.Helpers.FormHelper.MakeDirty(ShippingChargeTextBox); + return; + } + } + + + //Validation Check End + + //Now exposing the button click event. + this.OnSaveButtonClick(sender, e); + } + + protected void ProductGridView_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(); + //UpdatePanel1.Update(); + } + + protected void ProductGridView_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); + } + } + + #region "Page Initialization" + protected void Page_Init(object sender, EventArgs e) + { + if(!IsPostBack) + { + this.ClearSession(); + } + + this.InitializeControls(); + this.BindGridView(); + ScriptManager1.RegisterAsyncPostBackControl(ProductGridView); + } + + private void ClearSession() + { + if(Session[this.ID] != null) + { + Session.Remove(this.ID); + } + } + + private void LoadCostCenters() + { + if(this.SubType == SubTranType.Direct || this.SubType == SubTranType.Invoice || this.SubType == SubTranType.Delivery || this.SubType == SubTranType.Receipt) + { + MixERP.Net.BusinessLayer.Helpers.DropDownListHelper.BindDropDownList(CostCenterDropDownList, "office", "cost_centers", "cost_center_id", MixERP.Net.BusinessLayer.Office.CostCenters.GetDisplayField()); + } + else + { + CostCenterRow.Visible = false; + } + } + + private void LoadStores() + { + if(this.SubType == SubTranType.Direct || this.SubType == SubTranType.Invoice || this.SubType == SubTranType.Delivery || this.SubType == SubTranType.Receipt) + { + MixERP.Net.BusinessLayer.Helpers.DropDownListHelper.BindDropDownList(StoreDropDownList, "office", "stores", "store_id", MixERP.Net.BusinessLayer.Office.Stores.GetDisplayField()); + } + else + { + StoreLiteral.Visible = false; + StoreDropDownList.Visible = false; + } + } + + private void LoadCashRepositories() + { + if(this.ShowCashRepository) + { + using(System.Data.DataTable table = MixERP.Net.BusinessLayer.Office.CashRepositories.GetCashRepositories(MixERP.Net.BusinessLayer.Helpers.SessionHelper.OfficeId())) + { + MixERP.Net.BusinessLayer.Helpers.DropDownListHelper.BindDropDownList(CashRepositoryDropDownList, table, "cash_repository_id", MixERP.Net.BusinessLayer.Office.CashRepositories.GetDisplayField()); + this.UpdateRepositoryBalance(); + } + } + else + { + CashRepositoryRow.Visible = false; + CashRepositoryBalanceRow.Visible = false; + } + } + + private void LoadLabels() + { + DateLiteral.Text = ""; + StoreLiteral.Text = ""; + + PartyLiteral.Text = ""; + PriceTypeLiteral.Text = ""; + ReferenceNumberLiteral.Text = ""; + + RunningTotalTextBoxLabelLiteral.Text = ""; + TaxTotalTextBoxLabelLiteral.Text = ""; + GrandTotalTextBoxLabelLiteral.Text = ""; + ShippingAddressDropDownListLabelLiteral.Text = ""; + ShippingCompanyDropDownListLabelLiteral.Text = ""; + ShippingChargeTextBoxLabelLiteral.Text = ""; + CashRepositoryDropDownListLabelLiteral.Text = ""; + CashRepositoryBalanceTextBoxLabelLiteral.Text = ""; + CostCenterDropDownListLabelLiteral.Text = ""; + SalesPersonDropDownListLabelLiteral.Text = ""; + StatementReferenceTextBoxLabelLiteral.Text = ""; + } + + private void LoadTransactionTypeLabel() + { + if(this.TransactionType == TranType.Sales) + { + TransactionTypeLiteral.Text = ""; + } + else + { + TransactionTypeLiteral.Text = ""; + } + } + + private void LoadItems() + { + if(this.TransactionType == TranType.Sales) + { + ItemDropDownListCascadingDropDown.ServiceMethod = "GetItems"; + } + else + { + ItemDropDownListCascadingDropDown.ServiceMethod = "GetStockItems"; + } + } + + private void LoadPriceTypes() + { + if(this.TransactionType == TranType.Sales) + { + MixERP.Net.BusinessLayer.Helpers.DropDownListHelper.BindDropDownList(PriceTypeDropDownList, "core", "price_types", "price_type_id", MixERP.Net.BusinessLayer.Core.PriceTypes.GetDisplayField()); + } + else + { + PriceTypeLiteral.Visible = false; + PriceTypeDropDownList.Visible = false; + + ShippingAddressRow.Visible = false; + ShippingChargeRow.Visible = false; + ShippingCompanyRow.Visible = false; + } + + } + + private void LoadSalesPerson() + { + SalesPersonRow.Visible = false; + + if(this.TransactionType == TranType.Sales) + { + MixERP.Net.BusinessLayer.Helpers.DropDownListHelper.BindDropDownList(SalesPersonDropDownList, "core", "agents", "agent_id", MixERP.Net.BusinessLayer.Core.Agents.GetDisplayField()); + SalesPersonRow.Visible = true; + } + } + + private void LoadShippers() + { + ShippingAddressRow.Visible = false; + ShippingChargeRow.Visible = false; + ShippingCompanyRow.Visible = false; + + if(this.TransactionType == TranType.Sales) + { + if(this.SubType == SubTranType.Direct || this.SubType == SubTranType.Delivery) + { + MixERP.Net.BusinessLayer.Helpers.DropDownListHelper.BindDropDownList(ShippingCompanyDropDownList, "core", "shippers", "shipper_id", MixERP.Net.BusinessLayer.Core.Shippers.GetDisplayField()); + + ShippingAddressRow.Visible = true; + ShippingChargeRow.Visible = true; + ShippingCompanyRow.Visible = true; + } + } + } + + private void InitializeControls() + { + this.LoadLabels(); + this.LoadTransactionTypeLabel(); + this.LoadItems(); + this.LoadPriceTypes(); + this.LoadShippers(); + this.LoadCostCenters(); + this.LoadSalesPerson(); + this.LoadStores(); + this.LoadCashRepositories(); + } + #endregion + + protected void Page_Load(object sender, EventArgs e) + { + if(Request.Form["__EVENTTARGET"] != null) + { + Control c = this.Page.FindControl(Request.Form["__EVENTTARGET"]); + if(c != null) + { + if(c.ID.Equals(UnitDropDownList.ClientID)) + { + UnitDropDownList_SelectedIndexChanged(c, e); + } + } + } + + //Moved from Page_Init + this.TitleLabel.Text = this.Text; + this.Page.Title = this.Text; + TransactionTypeLiteral.Visible = this.DisplayTransactionTypeRadioButtonList; + TransactionTypeRadioButtonList.Visible = this.DisplayTransactionTypeRadioButtonList; + + this.SetControlStates(); + } + + private void BindGridView() + { + Collection table = this.GetTable(); + + ProductGridView.DataSource = table; + ProductGridView.DataBind(); + + this.ShowTotals(); + } + + protected void ShippingChargeTextBox_TextChanged(object sender, EventArgs e) + { + this.ShowTotals(); + + if(CashRepositoryBalanceRow.Visible) + { + CashRepositoryDropDownList.Focus(); + return; + } + + if(CostCenterRow.Visible) + { + CostCenterDropDownList.Focus(); + return; + } + + StatementReferenceTextBox.Focus(); + } + + private void ShowTotals() + { + Collection table = this.GetTable(); + + RunningTotalTextBox.Text = (this.GetRunningTotalOfSubTotal(table) + MixERP.Net.Common.Conversion.TryCastDecimal(ShippingChargeTextBox.Text)).ToString(System.Threading.Thread.CurrentThread.CurrentCulture); + TaxTotalTextBox.Text = this.GetRunningTotalOfTax(table).ToString(System.Threading.Thread.CurrentThread.CurrentCulture); + GrandTotalTextBox.Text = (this.GetRunningTotalOfTotal(table) + MixERP.Net.Common.Conversion.TryCastDecimal(ShippingChargeTextBox.Text)).ToString(System.Threading.Thread.CurrentThread.CurrentCulture); + + } + + #region "Running Totals" + private decimal GetRunningTotalOfSubTotal(Collection table) + { + decimal retVal = 0; + + if(table.Count > 0) + { + foreach(MixERP.Net.Common.Models.Transactions.ProductDetailsModel model in table) + { + retVal += MixERP.Net.Common.Conversion.TryCastDecimal(model.Subtotal); + } + } + + return retVal; + } + + private decimal GetRunningTotalOfTax(Collection table) + { + decimal retVal = 0; + + if(table.Count > 0) + { + foreach(MixERP.Net.Common.Models.Transactions.ProductDetailsModel model in table) + { + retVal += MixERP.Net.Common.Conversion.TryCastDecimal(model.Tax); + } + } + + return retVal; + } + + private decimal GetRunningTotalOfTotal(Collection table) + { + decimal retVal = 0; + + if(table.Count > 0) + { + foreach(MixERP.Net.Common.Models.Transactions.ProductDetailsModel model in table) + { + retVal += MixERP.Net.Common.Conversion.TryCastDecimal(model.Total); + } + } + + return retVal; + } + #endregion + + protected void CashRepositoryDropDownList_SelectIndexChanged(object sender, EventArgs e) + { + this.UpdateRepositoryBalance(); + } + + private void UpdateRepositoryBalance() + { + if(CashRepositoryBalanceRow.Visible) + { + if(CashRepositoryDropDownList.SelectedItem != null) + { + CashRepositoryBalanceTextBox.Text = MixERP.Net.BusinessLayer.Office.CashRepositories.GetBalance(MixERP.Net.Common.Conversion.TryCastInteger(CashRepositoryDropDownList.SelectedItem.Value)).ToString(System.Threading.Thread.CurrentThread.CurrentCulture); + } + } + } + + protected void AddButton_Click(object sender, EventArgs e) + { + string itemCode = ItemCodeTextBox.Text; + string itemName = ItemDropDownList.SelectedItem.Text; + int quantity = MixERP.Net.Common.Conversion.TryCastInteger(QuantityTextBox.Text); + string unit = UnitDropDownList.SelectedItem.Text; + int unitId = MixERP.Net.Common.Conversion.TryCastInteger(UnitDropDownList.SelectedItem.Value); + decimal itemInStock = 0; + decimal price = MixERP.Net.Common.Conversion.TryCastDecimal(PriceTextBox.Text); + decimal discount = MixERP.Net.Common.Conversion.TryCastDecimal(DiscountTextBox.Text); + decimal taxRate = MixERP.Net.Common.Conversion.TryCastDecimal(TaxRateTextBox.Text); + decimal tax = MixERP.Net.Common.Conversion.TryCastDecimal(TaxTextBox.Text); + int storeId = 0; + + if(StoreDropDownList.SelectedItem != null) + { + storeId = MixERP.Net.Common.Conversion.TryCastInteger(StoreDropDownList.SelectedItem.Value); + } + + #region Validation + + if(string.IsNullOrWhiteSpace(itemCode)) + { + MixERP.Net.BusinessLayer.Helpers.FormHelper.MakeDirty(ItemCodeTextBox); + return; + } + else + { + MixERP.Net.BusinessLayer.Helpers.FormHelper.RemoveDirty(ItemCodeTextBox); + } + + if(!MixERP.Net.BusinessLayer.Core.Items.ItemExistsByCode(itemCode)) + { + MixERP.Net.BusinessLayer.Helpers.FormHelper.MakeDirty(ItemCodeTextBox); + return; + } + else + { + MixERP.Net.BusinessLayer.Helpers.FormHelper.RemoveDirty(ItemCodeTextBox); + } + + if(quantity < 1) + { + MixERP.Net.BusinessLayer.Helpers.FormHelper.MakeDirty(QuantityTextBox); + return; + } + else + { + MixERP.Net.BusinessLayer.Helpers.FormHelper.RemoveDirty(QuantityTextBox); + } + + if(!MixERP.Net.BusinessLayer.Core.Units.UnitExistsByName(unit)) + { + MixERP.Net.BusinessLayer.Helpers.FormHelper.MakeDirty(UnitDropDownList); + return; + } + else + { + MixERP.Net.BusinessLayer.Helpers.FormHelper.RemoveDirty(UnitDropDownList); + } + + if(price <= 0) + { + MixERP.Net.BusinessLayer.Helpers.FormHelper.MakeDirty(PriceTextBox); + return; + } + else + { + MixERP.Net.BusinessLayer.Helpers.FormHelper.RemoveDirty(PriceTextBox); + } + + if(discount < 0) + { + MixERP.Net.BusinessLayer.Helpers.FormHelper.MakeDirty(DiscountTextBox); + return; + } + else + { + if(discount > (price * quantity)) + { + MixERP.Net.BusinessLayer.Helpers.FormHelper.MakeDirty(DiscountTextBox); + return; + } + else + { + MixERP.Net.BusinessLayer.Helpers.FormHelper.RemoveDirty(DiscountTextBox); + } + } + + + if(tax < 0) + { + MixERP.Net.BusinessLayer.Helpers.FormHelper.MakeDirty(TaxTextBox); + return; + } + else + { + MixERP.Net.BusinessLayer.Helpers.FormHelper.RemoveDirty(TaxTextBox); + } + + if(this.VerifyStock) + { + if(this.TransactionType == TranType.Sales) + { + if(MixERP.Net.BusinessLayer.Core.Items.IsStockItem(itemCode)) + { + itemInStock = MixERP.Net.BusinessLayer.Core.Items.CountItemInStock(itemCode, unitId, storeId); + if(quantity > itemInStock) + { + MixERP.Net.BusinessLayer.Helpers.FormHelper.MakeDirty(QuantityTextBox); + ErrorLabel.Text = String.Format(System.Threading.Thread.CurrentThread.CurrentCulture, Resources.Warnings.InsufficientStockWarning, itemInStock.ToString("G29", System.Threading.Thread.CurrentThread.CurrentCulture), UnitDropDownList.SelectedItem.Text, ItemDropDownList.SelectedItem.Text); + return; + } + } + } + } + #endregion + + this.AddRowToTable(itemCode, itemName, quantity, unit, price, discount, taxRate, tax); + + this.BindGridView(); + ItemCodeTextBox.Text = ""; + QuantityTextBox.Text = "1"; + PriceTextBox.Text = ""; + DiscountTextBox.Text = ""; + TaxTextBox.Text = ""; + + ItemCodeTextBox.Focus(); + } + + private void AddRowToTable(string itemCode, string itemName, int quantity, string unit, decimal price, decimal discount, decimal taxRate, decimal tax) + { + Collection table = this.GetTable(); + + decimal amount = price * quantity; + decimal subTotal = amount - discount; + decimal total = subTotal + tax; + + MixERP.Net.Common.Models.Transactions.ProductDetailsModel row = new Common.Models.Transactions.ProductDetailsModel(); + row.ItemCode = itemCode; + row.ItemName = itemName; + row.Quantity = quantity; + row.Unit = unit; + row.Price = price; + row.Amount = amount; + row.Discount = discount; + row.Subtotal = subTotal; + row.Rate = taxRate; + row.Tax = tax; + row.Total = total; + + table.Add(row); + Session[this.ID] = table; + } + + private Collection GetTable() + { + if(Session[this.ID] != null) + { + return (Collection)Session[this.ID]; + } + + return new Collection(); + } + + void UnitDropDownList_SelectedIndexChanged(object sender, EventArgs e) + { + this.DisplayPrice(); + PriceTextBox.Focus(); + } + + private void DisplayPrice() + { + string itemCode = ItemDropDownList.SelectedItem.Value; + string party = string.Empty; + + int unitId = MixERP.Net.Common.Conversion.TryCastInteger(UnitDropDownList.SelectedItem.Value); + + decimal price = 0; + + if(this.TransactionType == TranType.Sales) + { + party = PartyDropDownList.SelectedItem.Value; + short priceTypeId = MixERP.Net.Common.Conversion.TryCastShort(PriceTypeDropDownList.SelectedItem.Value); + price = MixERP.Net.BusinessLayer.Core.Items.GetItemSellingPrice(itemCode, party, priceTypeId, unitId); + } + else + { + party = PartyDropDownList.SelectedItem.Value; + price = MixERP.Net.BusinessLayer.Core.Items.GetItemCostPrice(itemCode, party, unitId); + } + + decimal discount = MixERP.Net.Common.Conversion.TryCastDecimal(DiscountTextBox.Text); + decimal taxRate = MixERP.Net.BusinessLayer.Core.Items.GetTaxRate(itemCode); + + + PriceTextBox.Text = price.ToString(System.Threading.Thread.CurrentThread.CurrentCulture); + + TaxRateTextBox.Text = taxRate.ToString(System.Threading.Thread.CurrentThread.CurrentCulture); + TaxTextBox.Text = (((price - discount) * taxRate) / 100.00m).ToString("#.##", System.Threading.Thread.CurrentThread.CurrentCulture); + + decimal amount = price * MixERP.Net.Common.Conversion.TryCastInteger(QuantityTextBox.Text); + + AmountTextBox.Text = amount.ToString(System.Threading.Thread.CurrentThread.CurrentCulture); + } + + protected void OKButton_Click(object sender, EventArgs e) + { + DateTime valueDate = DateTime.MinValue; + int storeId = 0; + string transactionType = string.Empty; + string partyCode = string.Empty; + partyCode = PartyDropDownList.SelectedItem.Value; + + if(DateTextBox != null) + { + valueDate = MixERP.Net.Common.Conversion.TryCastDate(DateTextBox.Text); + } + + if(StoreDropDownList.SelectedItem != null) + { + storeId = MixERP.Net.Common.Conversion.TryCastInteger(StoreDropDownList.SelectedItem.Value); + } + + if(TransactionTypeRadioButtonList.SelectedItem != null) + { + transactionType = TransactionTypeRadioButtonList.SelectedItem.Value; + } + + + if(string.IsNullOrWhiteSpace(partyCode)) + { + MixERP.Net.BusinessLayer.Helpers.FormHelper.MakeDirty(PartyCodeTextBox); + MixERP.Net.BusinessLayer.Helpers.FormHelper.MakeDirty(PartyDropDownList); + PartyCodeTextBox.Focus(); + return; + } + + if(valueDate.Equals(DateTime.MinValue)) + { + ErrorLabelTop.Text = Resources.Warnings.InvalidDate; + DateTextBox.CssClass = "dirty"; + DateTextBox.Focus(); + return; + } + + if(this.TransactionType == TranType.Sales) + { + if(StoreDropDownList.Visible) + { + if(!MixERP.Net.BusinessLayer.Office.Stores.IsSalesAllowed(storeId)) + { + ErrorLabelTop.Text = Resources.Warnings.SalesNotAllowedHere; + MixERP.Net.BusinessLayer.Helpers.FormHelper.MakeDirty(StoreDropDownList); + return; + } + } + + if(TransactionTypeRadioButtonList.Visible) + { + if(transactionType.Equals(Resources.Titles.Credit)) + { + if(!MixERP.Net.BusinessLayer.Core.Parties.IsCreditAllowed(partyCode)) + { + ErrorLabelTop.Text = Resources.Warnings.CreditNotAllowed; + return; + } + } + } + } + + ModeHiddenField.Value = "Started"; + this.SetControlStates(); + ItemCodeTextBox.Focus(); + } + + protected void CancelButton_Click(object sender, EventArgs e) + { + ModeHiddenField.Value = ""; + + Session[this.ID] = null; + RunningTotalTextBox.Text = ""; + TaxTotalTextBox.Text = ""; + GrandTotalTextBox.Text = ""; + + this.SetControlStates(); + this.BindGridView(); + } + + private void SetControlStates() + { + bool state = ModeHiddenField.Value.Equals("Started"); + + FormPanel.Enabled = state; + BottomPanel.Enabled = state; + DateTextBox.Disabled = state; + StoreDropDownList.Enabled = !state; + TransactionTypeRadioButtonList.Enabled = !state; + PartyCodeTextBox.Enabled = !state; + PartyDropDownList.Enabled = !state; + PriceTypeDropDownList.Enabled = !state; + ReferenceNumberTextBox.Enabled = !state; + OKButton.Enabled = !state; + CancelButton.Enabled = state; + + if(TransactionTypeRadioButtonList.Visible) + { + if(TransactionTypeRadioButtonList.SelectedItem.Value.Equals(Resources.Titles.Credit)) + { + CashRepositoryRow.Visible = false; + CashRepositoryBalanceRow.Visible = false; + } + } + + } + } +} \ No newline at end of file diff --git a/MixERP.Net.FrontEnd/UserControls/Products/ProductControl.ascx.designer.cs b/MixERP.Net.FrontEnd/UserControls/Products/ProductControl.ascx.designer.cs new file mode 100644 index 000000000..59fd9cdbb --- /dev/null +++ b/MixERP.Net.FrontEnd/UserControls/Products/ProductControl.ascx.designer.cs @@ -0,0 +1,708 @@ +//------------------------------------------------------------------------------ +// +// 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.Products { + + + public partial class ProductControl { + + /// + /// 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; + + /// + /// ModeHiddenField control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.HiddenField ModeHiddenField; + + /// + /// TopPanel control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Panel TopPanel; + + /// + /// DateLiteral control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Literal DateLiteral; + + /// + /// StoreLiteral control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Literal StoreLiteral; + + /// + /// TransactionTypeLiteral control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Literal TransactionTypeLiteral; + + /// + /// PartyLiteral control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Literal PartyLiteral; + + /// + /// PriceTypeLiteral control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Literal PriceTypeLiteral; + + /// + /// 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; + + /// + /// DateTextBox control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::MixERP.Net.FrontEnd.UserControls.DateTextBox DateTextBox; + + /// + /// StoreDropDownList control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.DropDownList StoreDropDownList; + + /// + /// TransactionTypeRadioButtonList control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.RadioButtonList TransactionTypeRadioButtonList; + + /// + /// PartyCodeTextBox control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox PartyCodeTextBox; + + /// + /// PartyDropDownList control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.DropDownList PartyDropDownList; + + /// + /// PartyDropDownListCascadingDropDown control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::AjaxControlToolkit.CascadingDropDown PartyDropDownListCascadingDropDown; + + /// + /// PriceTypeDropDownList control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.DropDownList PriceTypeDropDownList; + + /// + /// 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; + + /// + /// OKButton control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Button OKButton; + + /// + /// CancelButton control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Button CancelButton; + + /// + /// ErrorLabelTop control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Label ErrorLabelTop; + + /// + /// ProductGridView control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.GridView ProductGridView; + + /// + /// FormPanel control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Panel FormPanel; + + /// + /// FormTable control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.HtmlControls.HtmlTable FormTable; + + /// + /// ItemCodeTextBox control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox ItemCodeTextBox; + + /// + /// ItemDropDownList control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.DropDownList ItemDropDownList; + + /// + /// ItemDropDownListCascadingDropDown control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::AjaxControlToolkit.CascadingDropDown ItemDropDownListCascadingDropDown; + + /// + /// QuantityTextBox control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox QuantityTextBox; + + /// + /// UnitDropDownList control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.DropDownList UnitDropDownList; + + /// + /// UnitDropDownListCascadingDropDown control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::AjaxControlToolkit.CascadingDropDown UnitDropDownListCascadingDropDown; + + /// + /// PriceTextBox control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox PriceTextBox; + + /// + /// AmountTextBox control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox AmountTextBox; + + /// + /// DiscountTextBox control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox DiscountTextBox; + + /// + /// SubTotalTextBox control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox SubTotalTextBox; + + /// + /// TaxRateTextBox control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox TaxRateTextBox; + + /// + /// TaxTextBox control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox TaxTextBox; + + /// + /// TotalTextBox control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox TotalTextBox; + + /// + /// 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; + + /// + /// ErrorLabel control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Label ErrorLabel; + + /// + /// BottomPanel control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Panel BottomPanel; + + /// + /// ShippingAddressRow control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TableRow ShippingAddressRow; + + /// + /// ShippingAddressDropDownListLabelLiteral control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Literal ShippingAddressDropDownListLabelLiteral; + + /// + /// ShippingAddressDropDownList control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.DropDownList ShippingAddressDropDownList; + + /// + /// ShippingAddressDropDownListCascadingDropDown control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::AjaxControlToolkit.CascadingDropDown ShippingAddressDropDownListCascadingDropDown; + + /// + /// ShippingAddressTextBox control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox ShippingAddressTextBox; + + /// + /// ShippingCompanyRow control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TableRow ShippingCompanyRow; + + /// + /// ShippingCompanyDropDownListLabelLiteral control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Literal ShippingCompanyDropDownListLabelLiteral; + + /// + /// ShippingCompanyDropDownList control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.DropDownList ShippingCompanyDropDownList; + + /// + /// ShippingChargeRow control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TableRow ShippingChargeRow; + + /// + /// ShippingChargeTextBoxLabelLiteral control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Literal ShippingChargeTextBoxLabelLiteral; + + /// + /// ShippingChargeTextBox control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox ShippingChargeTextBox; + + /// + /// TotalsLiteral control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Literal TotalsLiteral; + + /// + /// RunningTotalTextBoxLabelLiteral control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Literal RunningTotalTextBoxLabelLiteral; + + /// + /// TaxTotalTextBoxLabelLiteral control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Literal TaxTotalTextBoxLabelLiteral; + + /// + /// GrandTotalTextBoxLabelLiteral control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Literal GrandTotalTextBoxLabelLiteral; + + /// + /// RunningTotalTextBox control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox RunningTotalTextBox; + + /// + /// TaxTotalTextBox control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox TaxTotalTextBox; + + /// + /// GrandTotalTextBox control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox GrandTotalTextBox; + + /// + /// CashRepositoryRow control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TableRow CashRepositoryRow; + + /// + /// CashRepositoryDropDownListLabelLiteral control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Literal CashRepositoryDropDownListLabelLiteral; + + /// + /// 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; + + /// + /// CashRepositoryBalanceRow control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TableRow CashRepositoryBalanceRow; + + /// + /// CashRepositoryBalanceTextBoxLabelLiteral control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Literal CashRepositoryBalanceTextBoxLabelLiteral; + + /// + /// CashRepositoryBalanceTextBox control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox CashRepositoryBalanceTextBox; + + /// + /// DrLiteral control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Literal DrLiteral; + + /// + /// CostCenterRow control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TableRow CostCenterRow; + + /// + /// CostCenterDropDownListLabelLiteral control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Literal CostCenterDropDownListLabelLiteral; + + /// + /// 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; + + /// + /// SalesPersonRow control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TableRow SalesPersonRow; + + /// + /// SalesPersonDropDownListLabelLiteral control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Literal SalesPersonDropDownListLabelLiteral; + + /// + /// SalesPersonDropDownList control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.DropDownList SalesPersonDropDownList; + + /// + /// StatementReferenceTextBoxLabelLiteral control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Literal StatementReferenceTextBoxLabelLiteral; + + /// + /// 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; + + /// + /// 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; + + /// + /// ErrorLabelBottom control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Label ErrorLabelBottom; + } +} diff --git a/MixERP.Net.FrontEnd/UserControls/Products/ProductViewControl.ascx b/MixERP.Net.FrontEnd/UserControls/Products/ProductViewControl.ascx new file mode 100644 index 000000000..2c46fb4dc --- /dev/null +++ b/MixERP.Net.FrontEnd/UserControls/Products/ProductViewControl.ascx @@ -0,0 +1,103 @@ +<%-- +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="ProductViewControl.ascx.cs" Inherits="MixERP.Net.FrontEnd.UserControls.Products.ProductViewControl" %> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/MixERP.Net.FrontEnd/UserControls/Products/ProductViewControl.ascx.cs b/MixERP.Net.FrontEnd/UserControls/Products/ProductViewControl.ascx.cs new file mode 100644 index 000000000..67760de81 --- /dev/null +++ b/MixERP.Net.FrontEnd/UserControls/Products/ProductViewControl.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.Products +{ + public partial class ProductViewControl : 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/Products/ProductViewControl.ascx.designer.cs b/MixERP.Net.FrontEnd/UserControls/Products/ProductViewControl.ascx.designer.cs new file mode 100644 index 000000000..c5faa1ccf --- /dev/null +++ b/MixERP.Net.FrontEnd/UserControls/Products/ProductViewControl.ascx.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.UserControls.Products { + + + public partial class ProductViewControl { + + /// + /// 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; + + /// + /// SalesQuotationGridView control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.GridView SalesQuotationGridView; + } +} diff --git a/MixERP.Net.FrontEnd/UserControls/ReportControl.ascx b/MixERP.Net.FrontEnd/UserControls/ReportControl.ascx new file mode 100644 index 000000000..1d35d41e7 --- /dev/null +++ b/MixERP.Net.FrontEnd/UserControls/ReportControl.ascx @@ -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/. +--%> +<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="ReportControl.ascx.cs" Inherits="MixERP.Net.FrontEnd.UserControls.ReportControl" %> + + + + + +
    + + +

    + +

    +
    + + + + + + + +
    +
    + + diff --git a/MixERP.Net.FrontEnd/UserControls/ReportControl.ascx.cs b/MixERP.Net.FrontEnd/UserControls/ReportControl.ascx.cs new file mode 100644 index 000000000..a90958228 --- /dev/null +++ b/MixERP.Net.FrontEnd/UserControls/ReportControl.ascx.cs @@ -0,0 +1,464 @@ +/******************************************************************************** +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.IO; +using System.Linq; +using System.Text.RegularExpressions; +using System.Web; +using System.Web.UI; +using System.Web.UI.WebControls; +using System.Xml; +using System.Xml.Linq; +using MixERP.Net.BusinessLayer.Helpers; + +namespace MixERP.Net.FrontEnd.UserControls +{ + public partial class ReportControl : System.Web.UI.UserControl + { + public string ReportPath { get; set; } + public bool AutoInitialize { get; set; } + + /// + /// Collection of each datasources' parameter collection. + /// The datasource parameter collection is a collection of + /// parameters stored in KeyValuePair. + /// + public Collection>> ParameterCollection { get; set; } + private string path; + + private bool IsValid() + { + if(string.IsNullOrWhiteSpace(this.ReportPath)) + { + return false; + } + + this.path = Server.MapPath(this.ReportPath); + + if(!System.IO.File.Exists(this.path)) + { + return false; + } + + return true; + } + + protected void Page_Load(object sender, EventArgs e) + { + if(this.AutoInitialize) + { + this.InitializeReport(); + } + } + + public void InitializeReport() + { + //Check if the set report path is a valid file. + if(!this.IsValid()) + { + ReportTitleLiteral.Text = Resources.Titles.ReportNotFound; + ReportTitleHidden.Value = ReportTitleLiteral.Text; + TopSectionLiteral.Text = string.Format(System.Threading.Thread.CurrentThread.CurrentCulture, Resources.Warnings.InvalidLocation, this.path); + return; + } + + this.SetDecimalFields(); + this.SetRunningTotalFields(); + this.SetDataSources(); + this.SetTitle(); + this.SetTopSection(); + this.SetBodySection(); + this.SetGridViews(); + this.SetBottomSection(); + this.CleanUp(); + } + + private void CleanUp() + { + for(int i = 0; i < this.DataTableCollection.Count - 1; i++) + { + System.Data.DataTable table = this.DataTableCollection[i]; + if(table != null) + { + table.Dispose(); + if(table != null) + { + table = null; + } + } + + } + } + + private System.Collections.ObjectModel.Collection DecimalFieldIndicesCollection { get; set; } + private void SetDecimalFields() + { + string decimalFieldIndices = string.Empty; + + //Get the list of datasources for this report. + XmlNodeList dataSourceList = XmlHelper.GetNodes(path, "//DataSource"); + + //Initializing decimal field indices collection. + this.DecimalFieldIndicesCollection = new System.Collections.ObjectModel.Collection(); + + //Loop through each datasource in the datasource list. + foreach(XmlNode dataSource in dataSourceList) + { + //Resetting the variable for each iteration. + decimalFieldIndices = string.Empty; + + //Loop through each datasource child node. + foreach(XmlNode node in dataSource.ChildNodes) + { + //Selecting the nodes matching the tag . + if(node.Name.Equals("DecimalFieldIndices")) + { + decimalFieldIndices = node.InnerText; + } + } + + //Add current "DecimalFieldIndices" to the collection object. + //If a child node is found which matches the tag + //under the current node, the variable "decimalFieldIndices" will have + //a value. If not, an empty string will be added to the collection. + this.DecimalFieldIndicesCollection.Add(decimalFieldIndices); + } + } + + private System.Collections.ObjectModel.Collection RunningTotalTextColumnIndexCollection { get; set; } + private System.Collections.ObjectModel.Collection RunningTotalFieldIndicesCollection { get; set; } + private void SetRunningTotalFields() + { + //Get the list of datasources for this report. + XmlNodeList dataSourceList = XmlHelper.GetNodes(path, "//DataSource"); + int runningTotalTextColumnIndex = 0; + string runningTotalFieldIndices = string.Empty; + + //Initializing running total text column index collection. + this.RunningTotalTextColumnIndexCollection = new System.Collections.ObjectModel.Collection(); + + //Initializing running total field indices collection. + this.RunningTotalFieldIndicesCollection = new System.Collections.ObjectModel.Collection(); + + //Loop through each datasource in the datasource list. + foreach(XmlNode dataSource in dataSourceList) + { + //Resetting the variables for each iteration. + runningTotalTextColumnIndex = 0; + runningTotalFieldIndices = string.Empty; + + //Loop through each datasource child node. + foreach(XmlNode node in dataSource.ChildNodes) + { + //Selecting the nodes matching the tag . + if(node.Name.Equals("RunningTotalTextColumnIndex")) + { + runningTotalTextColumnIndex = MixERP.Net.Common.Conversion.TryCastInteger(node.InnerText); + } + + //Selecting the nodes matching the tag . + if(node.Name.Equals("RunningTotalFieldIndices")) + { + runningTotalFieldIndices = node.InnerText; + } + } + + //Add current "RunningTotalTextColumnIndexCollection" and "RunningTotalFieldIndicesCollection" + //to the collection object. + //If child nodes are found which match the the associated tags + //under the current node, the variable "runningTotalTextColumnIndex" and "runningTotalFieldIndices" will have + //values. If not, an empty string for "runningTotalFieldIndices" and zero for "runningTotalTextColumnIndex" + //will be added to the collection. + this.RunningTotalTextColumnIndexCollection.Add(runningTotalTextColumnIndex); + this.RunningTotalFieldIndicesCollection.Add(runningTotalFieldIndices); + } + } + + private System.Collections.ObjectModel.Collection DataTableCollection { get; set; } + private void SetDataSources() + { + int index = 0; + + //Get the list of datasources for this report. + System.Xml.XmlNodeList dataSources = XmlHelper.GetNodes(path, "//DataSource"); + + //Initializing data source collection. + this.DataTableCollection = new System.Collections.ObjectModel.Collection(); + + //Loop through each datasource in the datasource list. + foreach(System.Xml.XmlNode datasource in dataSources) + { + //Loop through each datasource child node. + foreach(System.Xml.XmlNode c in datasource.ChildNodes) + { + //Selecting the nodes matching the tag . + if(c.Name.Equals("Query")) + { + index++; + string sql = c.InnerText; + + //Initializing query parameter collection. + Collection> parameters = new Collection>(); + + //Check if this report needs has has parameters. + if(this.ParameterCollection != null) + { + //Get the parameter collection for this datasource. + parameters = this.ParameterCollection[index - 1]; + } + + //Get DataTable from SQL Query and parameter collection. + using(System.Data.DataTable table = MixERP.Net.BusinessLayer.Helpers.ReportHelper.GetDataTable(sql, parameters)) + { + //Add this datatable to the collection for later binding. + this.DataTableCollection.Add(table); + } + } + } + } + } + + private void SetTitle() + { + string title = XmlHelper.GetNodeText(path, "/PesReport/Title"); + ReportTitleLiteral.Text = MixERP.Net.BusinessLayer.Helpers.ReportHelper.Parse(title); + ReportTitleHidden.Value = ReportTitleLiteral.Text; + + if(!string.IsNullOrWhiteSpace(ReportTitleLiteral.Text)) + { + this.Page.Title = ReportTitleLiteral.Text; + } + } + + private void SetTopSection() + { + string topSection = XmlHelper.GetNodeText(path, "/PesReport/TopSection"); + topSection = MixERP.Net.BusinessLayer.Helpers.ReportHelper.Parse(topSection); + topSection = ParseDataSource(topSection, this.DataTableCollection); + TopSectionLiteral.Text = topSection; + } + + private void SetBodySection() + { + string bodySection = XmlHelper.GetNodeText(path, "/PesReport/Body/Content"); + bodySection = MixERP.Net.BusinessLayer.Helpers.ReportHelper.Parse(bodySection); + bodySection = ParseDataSource(bodySection, this.DataTableCollection); + ContentLiteral.Text = bodySection; + } + + private void SetGridViews() + { + XmlNodeList gridViewDataSource = XmlHelper.GetNodes(path, "//GridViewDataSource"); + string gridSection = string.Empty; + + foreach(XmlNode node in gridViewDataSource) + { + if(!string.IsNullOrWhiteSpace(node.InnerText)) + { + gridSection += node.InnerText.Trim() + ","; + } + } + + this.LoadGrid(string.Concat(gridSection)); + } + + private void LoadGrid(string indices) + { + foreach(string data in indices.Split(',')) + { + string ds = data.Trim(); + + if(!string.IsNullOrWhiteSpace(ds)) + { + + //if(!ds.Contains(' ')) + //{ + int index = MixERP.Net.Common.Conversion.TryCastInteger(ds); + + GridView grid = new GridView(); + grid.EnableTheming = false; + + grid.ID = "GridView" + ds; + grid.CssClass = "report"; + + grid.Width = Unit.Percentage(100); + grid.GridLines = GridLines.Both; + grid.RowDataBound += GridView_RowDataBound; + grid.DataBound += GridView_DataBound; + BodyPlaceHolder.Controls.Add(grid); + + grid.DataSource = this.DataTableCollection[index]; + grid.DataBind(); + //} + } + } + + } + + private void SetBottomSection() + { + string bottomSection = XmlHelper.GetNodeText(path, "/PesReport/BottomSection"); + bottomSection = MixERP.Net.BusinessLayer.Helpers.ReportHelper.Parse(bottomSection); + bottomSection = ParseDataSource(bottomSection, this.DataTableCollection); + BottomSectionLiteral.Text = bottomSection; + } + + void GridView_DataBound(object sender, EventArgs e) + { + GridView grid = (GridView)sender; + + int arg = MixERP.Net.Common.Conversion.TryCastInteger(grid.ID.Replace("GridView", "")); + + if(string.IsNullOrWhiteSpace(this.RunningTotalFieldIndicesCollection[arg])) + { + return; + } + + if(grid.FooterRow == null) + { + return; + } + + grid.FooterRow.Visible = true; + + for(int i = 0; i < this.RunningTotalTextColumnIndexCollection[arg]; i++) + { + grid.FooterRow.Cells[i].Visible = false; + } + + grid.FooterRow.Cells[this.RunningTotalTextColumnIndexCollection[arg]].ColumnSpan = this.RunningTotalTextColumnIndexCollection[arg] + 1; + grid.FooterRow.Cells[this.RunningTotalTextColumnIndexCollection[arg]].Text = Resources.Titles.Total; + grid.FooterRow.Cells[this.RunningTotalTextColumnIndexCollection[arg]].Style.Add("text-align", "right"); + grid.FooterRow.Cells[this.RunningTotalTextColumnIndexCollection[arg]].Font.Bold = true; + + foreach(string field in this.RunningTotalFieldIndicesCollection[arg].Split(',')) + { + int index = MixERP.Net.Common.Conversion.TryCastInteger(field.Trim()); + + decimal total = 0; + + if(index > 0) + { + foreach(GridViewRow row in grid.Rows) + { + if(row.RowType == DataControlRowType.DataRow) + { + total += MixERP.Net.Common.Conversion.TryCastDecimal(row.Cells[index].Text); + } + } + + grid.FooterRow.Cells[index].Text = string.Format(System.Threading.Thread.CurrentThread.CurrentCulture, "{0:N}", total); + grid.FooterRow.Cells[index].Font.Bold = true; + } + } + } + + void GridView_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; + + cellText = MixERP.Net.Common.Helpers.LocalizationHelper.GetResourceString("FormResource", cellText, false); + e.Row.Cells[i].Text = cellText; + e.Row.Cells[i].HorizontalAlign = HorizontalAlign.Left; + } + } + + if(e.Row.RowType == DataControlRowType.DataRow) + { + GridView grid = (GridView)sender; + int arg = MixERP.Net.Common.Conversion.TryCastInteger(grid.ID.Replace("GridView", "")); + + //Apply formatting on decimal fields + if(string.IsNullOrWhiteSpace(this.DecimalFieldIndicesCollection[arg])) + { + return; + } + + + string decimalFields = this.DecimalFieldIndicesCollection[arg]; + foreach(string fieldIndex in decimalFields.Split(',')) + { + int index = MixERP.Net.Common.Conversion.TryCastInteger(fieldIndex); + decimal value = MixERP.Net.Common.Conversion.TryCastDecimal(e.Row.Cells[index].Text); + e.Row.Cells[index].Text = string.Format(System.Threading.Thread.CurrentThread.CurrentCulture, "{0:N}", value); + } + } + } + + public static string ParseDataSource(string expression, System.Collections.ObjectModel.Collection table) + { + foreach(var match in Regex.Matches(expression, "{.*?}")) + { + string word = match.ToString(); + + if(word.StartsWith("{DataSource", StringComparison.OrdinalIgnoreCase)) + { + + int index = MixERP.Net.Common.Conversion.TryCastInteger(word.Split('.').First().Replace("{DataSource[", "").Replace("]", "")); + string column = word.Split('.').Last().Replace("}", ""); + + if(table[index] != null) + { + if(table[index].Rows.Count > 0) + { + if(table[index].Columns.Contains(column)) + { + string value = table[index].Rows[0][column].ToString(); + expression = expression.Replace(word, value); + } + } + } + } + } + + return expression; + } + + protected void ExcelImageButton_Click(object sender, ImageClickEventArgs e) + { + string html = ReportHidden.Value; + if(!string.IsNullOrWhiteSpace(html)) + { + Response.ContentType = "application/force-download"; + Response.AddHeader("content-disposition", "attachment; filename=" + ReportTitleHidden.Value + ".xls"); + Response.Charset = ""; + Response.Cache.SetCacheability(HttpCacheability.NoCache); + Response.ContentType = "application/vnd.ms-excel"; + Response.Write(html); + Response.Flush(); + Response.Close(); + } + } + + protected void WordImageButton_Click(object sender, ImageClickEventArgs e) + { + string html = ReportHidden.Value; + if(!string.IsNullOrWhiteSpace(html)) + { + Response.ContentType = "application/force-download"; + Response.AddHeader("content-disposition", "attachment; filename=" + ReportTitleHidden.Value + ".doc"); + Response.Charset = ""; + Response.Cache.SetCacheability(HttpCacheability.NoCache); + Response.ContentType = "application/vnd.ms-word"; + Response.Write(html); + Response.Flush(); + Response.Close(); + } + } + + + } + +} + diff --git a/MixERP.Net.FrontEnd/UserControls/ReportControl.ascx.designer.cs b/MixERP.Net.FrontEnd/UserControls/ReportControl.ascx.designer.cs new file mode 100644 index 000000000..83b6e6713 --- /dev/null +++ b/MixERP.Net.FrontEnd/UserControls/ReportControl.ascx.designer.cs @@ -0,0 +1,105 @@ +//------------------------------------------------------------------------------ +// +// 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 ReportControl { + + /// + /// ReportHidden control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.HiddenField ReportHidden; + + /// + /// ReportTitleHidden control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.HiddenField ReportTitleHidden; + + /// + /// SendEmailImageButton control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.ImageButton SendEmailImageButton; + + /// + /// ExcelImageButton control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.ImageButton ExcelImageButton; + + /// + /// WordImageButton control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.ImageButton WordImageButton; + + /// + /// ReportTitleLiteral control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Literal ReportTitleLiteral; + + /// + /// TopSectionLiteral control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Literal TopSectionLiteral; + + /// + /// BodyPlaceHolder control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.PlaceHolder BodyPlaceHolder; + + /// + /// ContentLiteral control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Literal ContentLiteral; + + /// + /// BottomSectionLiteral control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Literal BottomSectionLiteral; + } +} diff --git a/MixERP.Net.FrontEnd/UserControls/Reporting/Header.ascx b/MixERP.Net.FrontEnd/UserControls/Reporting/Header.ascx new file mode 100644 index 000000000..bc0d42611 --- /dev/null +++ b/MixERP.Net.FrontEnd/UserControls/Reporting/Header.ascx @@ -0,0 +1,12 @@ +<%-- +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="Header.ascx.cs" Inherits="MixERP.Net.FrontEnd.UserControls.Reporting.Header" %> + +
    + +
    \ No newline at end of file diff --git a/MixERP.Net.FrontEnd/UserControls/Reporting/Header.ascx.cs b/MixERP.Net.FrontEnd/UserControls/Reporting/Header.ascx.cs new file mode 100644 index 000000000..72b441f16 --- /dev/null +++ b/MixERP.Net.FrontEnd/UserControls/Reporting/Header.ascx.cs @@ -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/. +***********************************************************************************/ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text.RegularExpressions; +using System.Web; +using System.Web.UI; +using System.Web.UI.WebControls; + +namespace MixERP.Net.FrontEnd.UserControls.Reporting +{ + public partial class Header : System.Web.UI.UserControl + { + private string html; + + public string GetHtml() + { + return html; + } + + protected void Page_Load(object sender, EventArgs e) + { + string header = System.IO.File.ReadAllText(Server.MapPath("~/Reports/Assets/Header.html")); + html = MixERP.Net.BusinessLayer.Helpers.ReportHelper.Parse(header); + HeaderLiteral.Text = html; + } + + + + } +} \ No newline at end of file diff --git a/MixERP.Net.FrontEnd/UserControls/Reporting/Header.ascx.designer.cs b/MixERP.Net.FrontEnd/UserControls/Reporting/Header.ascx.designer.cs new file mode 100644 index 000000000..216466691 --- /dev/null +++ b/MixERP.Net.FrontEnd/UserControls/Reporting/Header.ascx.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.UserControls.Reporting { + + + public partial class Header { + + protected System.Web.UI.WebControls.Literal HeaderLiteral; + } +} diff --git a/MixERP.Net.FrontEnd/UserControls/TransactionChecklistControl.ascx b/MixERP.Net.FrontEnd/UserControls/TransactionChecklistControl.ascx new file mode 100644 index 000000000..ce0fd4617 --- /dev/null +++ b/MixERP.Net.FrontEnd/UserControls/TransactionChecklistControl.ascx @@ -0,0 +1,162 @@ +<%-- +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="TransactionChecklistControl.ascx.cs" Inherits="MixERP.Net.FrontEnd.UserControls.TransactionChecklistControl" %> +

    + +

    +
    + + + + +
    + +
    +

    + +

    +
    + + + + + + + + +
    +
    + + + +
    + + + + + diff --git a/MixERP.Net.FrontEnd/UserControls/TransactionChecklistControl.ascx.cs b/MixERP.Net.FrontEnd/UserControls/TransactionChecklistControl.ascx.cs new file mode 100644 index 000000000..b50311ee5 --- /dev/null +++ b/MixERP.Net.FrontEnd/UserControls/TransactionChecklistControl.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 TransactionChecklistControl : 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/TransactionChecklistControl.ascx.designer.cs b/MixERP.Net.FrontEnd/UserControls/TransactionChecklistControl.ascx.designer.cs new file mode 100644 index 000000000..ebab1498e --- /dev/null +++ b/MixERP.Net.FrontEnd/UserControls/TransactionChecklistControl.ascx.designer.cs @@ -0,0 +1,177 @@ +//------------------------------------------------------------------------------ +// +// 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 TransactionChecklistControl { + + /// + /// 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; + + /// + /// VerificationLabel control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Label VerificationLabel; + + /// + /// ChecklistLiteral control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Literal ChecklistLiteral; + + /// + /// WithdrawButton control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.LinkButton WithdrawButton; + + /// + /// ViewInvoiceButton control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.LinkButton ViewInvoiceButton; + + /// + /// EmailInvoiceButton control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.LinkButton EmailInvoiceButton; + + /// + /// CustomerInvoiceButton control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.LinkButton CustomerInvoiceButton; + + /// + /// PrintReceiptButton control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.LinkButton PrintReceiptButton; + + /// + /// PrintGLButton control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.LinkButton PrintGLButton; + + /// + /// AttachmentButton control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.LinkButton AttachmentButton; + + /// + /// BackButton control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.LinkButton BackButton; + + /// + /// WithdrawTransactionLiteral control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Literal WithdrawTransactionLiteral; + + /// + /// ReasonLiteral control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Literal ReasonLiteral; + + /// + /// ReasonTextBox control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox ReasonTextBox; + + /// + /// ReasonTextBoxRequired control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.RequiredFieldValidator ReasonTextBoxRequired; + + /// + /// OKButton control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Button OKButton; + + /// + /// CancelButton control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Button CancelButton; + + /// + /// MessageLabel control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Label MessageLabel; + } +} diff --git a/MixERP.Net.FrontEnd/UserControls/Widgets/AlertsWidget.ascx b/MixERP.Net.FrontEnd/UserControls/Widgets/AlertsWidget.ascx new file mode 100644 index 000000000..3b620b372 --- /dev/null +++ b/MixERP.Net.FrontEnd/UserControls/Widgets/AlertsWidget.ascx @@ -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/. +--%> +<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="AlertsWidget.ascx.cs" Inherits="MixERP.Net.FrontEnd.UserControls.Widgets.AlertsWidget" %> + diff --git a/MixERP.Net.FrontEnd/UserControls/Widgets/AlertsWidget.ascx.cs b/MixERP.Net.FrontEnd/UserControls/Widgets/AlertsWidget.ascx.cs new file mode 100644 index 000000000..803952ee5 --- /dev/null +++ b/MixERP.Net.FrontEnd/UserControls/Widgets/AlertsWidget.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.Widgets +{ + public partial class AlertsWidget : 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/Widgets/AlertsWidget.ascx.designer.cs b/MixERP.Net.FrontEnd/UserControls/Widgets/AlertsWidget.ascx.designer.cs new file mode 100644 index 000000000..47a0184db --- /dev/null +++ b/MixERP.Net.FrontEnd/UserControls/Widgets/AlertsWidget.ascx.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.UserControls.Widgets { + + + public partial class AlertsWidget { + } +} diff --git a/MixERP.Net.FrontEnd/UserControls/Widgets/CurrentOfficeSalesByMonthWidget.ascx b/MixERP.Net.FrontEnd/UserControls/Widgets/CurrentOfficeSalesByMonthWidget.ascx new file mode 100644 index 000000000..b45964b1c --- /dev/null +++ b/MixERP.Net.FrontEnd/UserControls/Widgets/CurrentOfficeSalesByMonthWidget.ascx @@ -0,0 +1,43 @@ +<%-- +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="CurrentOfficeSalesByMonthWidget.ascx.cs" Inherits="MixERP.Net.FrontEnd.UserControls.Widgets.CurrentOfficeSalesByMonthWidget" %> +
    +
    + Sales By Month (In Thousands) (Todo: Admin Only) +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    diff --git a/MixERP.Net.FrontEnd/UserControls/Widgets/CurrentOfficeSalesByMonthWidget.ascx.cs b/MixERP.Net.FrontEnd/UserControls/Widgets/CurrentOfficeSalesByMonthWidget.ascx.cs new file mode 100644 index 000000000..9db6fc412 --- /dev/null +++ b/MixERP.Net.FrontEnd/UserControls/Widgets/CurrentOfficeSalesByMonthWidget.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.Widgets +{ + public partial class CurrentOfficeSalesByMonthWidget : 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/Widgets/CurrentOfficeSalesByMonthWidget.ascx.designer.cs b/MixERP.Net.FrontEnd/UserControls/Widgets/CurrentOfficeSalesByMonthWidget.ascx.designer.cs new file mode 100644 index 000000000..3ee433f7c --- /dev/null +++ b/MixERP.Net.FrontEnd/UserControls/Widgets/CurrentOfficeSalesByMonthWidget.ascx.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.UserControls.Widgets { + + + public partial class CurrentOfficeSalesByMonthWidget { + + protected System.Web.UI.DataVisualization.Charting.Chart ctl01; + } +} diff --git a/MixERP.Net.FrontEnd/UserControls/Widgets/LinksWidget.ascx b/MixERP.Net.FrontEnd/UserControls/Widgets/LinksWidget.ascx new file mode 100644 index 000000000..d985ddb4e --- /dev/null +++ b/MixERP.Net.FrontEnd/UserControls/Widgets/LinksWidget.ascx @@ -0,0 +1,35 @@ +<%-- +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="LinksWidget.ascx.cs" Inherits="MixERP.Net.FrontEnd.UserControls.Widgets.LinksWidget" %> +
    +
    + MixERP Links (Todo) +
    +
    + +
    +
    diff --git a/MixERP.Net.FrontEnd/UserControls/Widgets/LinksWidget.ascx.cs b/MixERP.Net.FrontEnd/UserControls/Widgets/LinksWidget.ascx.cs new file mode 100644 index 000000000..5c6a65107 --- /dev/null +++ b/MixERP.Net.FrontEnd/UserControls/Widgets/LinksWidget.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.Widgets +{ + public partial class LinksWidget : 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/Widgets/LinksWidget.ascx.designer.cs b/MixERP.Net.FrontEnd/UserControls/Widgets/LinksWidget.ascx.designer.cs new file mode 100644 index 000000000..775a263ce --- /dev/null +++ b/MixERP.Net.FrontEnd/UserControls/Widgets/LinksWidget.ascx.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.UserControls.Widgets { + + + public partial class LinksWidget { + } +} diff --git a/MixERP.Net.FrontEnd/UserControls/Widgets/OfficeInformationWidget.ascx b/MixERP.Net.FrontEnd/UserControls/Widgets/OfficeInformationWidget.ascx new file mode 100644 index 000000000..50e996178 --- /dev/null +++ b/MixERP.Net.FrontEnd/UserControls/Widgets/OfficeInformationWidget.ascx @@ -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/. +--%> +<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="OfficeInformationWidget.ascx.cs" Inherits="MixERP.Net.FrontEnd.UserControls.Widgets.OfficeInformationWidget" %> +
    +
    + Office Information (Todo) +
    +
    + Your Office : PES-NY-MEM (Memphis Branch) +
    + Logged in to : PES-NY-BK (Brooklyn Branch) +
    + Last Login IP : 192.168.0.200 +
    + Last Login On : <%=System.DateTime.Now.ToString() %> +
    + Current Login IP : 192.168.0.200 +
    + Current Login On: <%=System.DateTime.Now.ToString() %> +
    + Role : ADM (Administrators) +
    + Department : ITD (IT Department) +
    +
    diff --git a/MixERP.Net.FrontEnd/UserControls/Widgets/OfficeInformationWidget.ascx.cs b/MixERP.Net.FrontEnd/UserControls/Widgets/OfficeInformationWidget.ascx.cs new file mode 100644 index 000000000..53f4a190f --- /dev/null +++ b/MixERP.Net.FrontEnd/UserControls/Widgets/OfficeInformationWidget.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.Widgets +{ + public partial class OfficeInformationWidget : 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/Widgets/OfficeInformationWidget.ascx.designer.cs b/MixERP.Net.FrontEnd/UserControls/Widgets/OfficeInformationWidget.ascx.designer.cs new file mode 100644 index 000000000..f990fc0de --- /dev/null +++ b/MixERP.Net.FrontEnd/UserControls/Widgets/OfficeInformationWidget.ascx.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.UserControls.Widgets { + + + public partial class OfficeInformationWidget { + } +} diff --git a/MixERP.Net.FrontEnd/UserControls/Widgets/SalesByOfficeWidget.ascx b/MixERP.Net.FrontEnd/UserControls/Widgets/SalesByOfficeWidget.ascx new file mode 100644 index 000000000..62722e46e --- /dev/null +++ b/MixERP.Net.FrontEnd/UserControls/Widgets/SalesByOfficeWidget.ascx @@ -0,0 +1,75 @@ +<%-- +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="SalesByOfficeWidget.ascx.cs" Inherits="MixERP.Net.FrontEnd.UserControls.Widgets.SalesByOfficeWidget" %> +
    +
    + Sales By Office (Todo: Admin Only/Child Offices Only) +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    diff --git a/MixERP.Net.FrontEnd/UserControls/Widgets/SalesByOfficeWidget.ascx.cs b/MixERP.Net.FrontEnd/UserControls/Widgets/SalesByOfficeWidget.ascx.cs new file mode 100644 index 000000000..3bc2ed62a --- /dev/null +++ b/MixERP.Net.FrontEnd/UserControls/Widgets/SalesByOfficeWidget.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.Widgets +{ + public partial class SalesByOfficeWidget : 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/Widgets/SalesByOfficeWidget.ascx.designer.cs b/MixERP.Net.FrontEnd/UserControls/Widgets/SalesByOfficeWidget.ascx.designer.cs new file mode 100644 index 000000000..0156d6d7d --- /dev/null +++ b/MixERP.Net.FrontEnd/UserControls/Widgets/SalesByOfficeWidget.ascx.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.UserControls.Widgets { + + + public partial class SalesByOfficeWidget { + + protected System.Web.UI.DataVisualization.Charting.Chart ctl00; + } +} diff --git a/MixERP.Net.FrontEnd/UserControls/Widgets/TopSellingProductOfAllTimeCurrentWidget.ascx b/MixERP.Net.FrontEnd/UserControls/Widgets/TopSellingProductOfAllTimeCurrentWidget.ascx new file mode 100644 index 000000000..561ea94b2 --- /dev/null +++ b/MixERP.Net.FrontEnd/UserControls/Widgets/TopSellingProductOfAllTimeCurrentWidget.ascx @@ -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/. +--%> +<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="TopSellingProductOfAllTimeCurrentWidget.ascx.cs" Inherits="MixERP.Net.FrontEnd.UserControls.Widgets.TopSellingProductOfAllTimeCurrentWidget" %> +
    +
    + Top 5 Selling Products of All Time(Todo: Admin Only) +
    +
    + + + + + + + + + + + + + + + + + + + + +
    +
    diff --git a/MixERP.Net.FrontEnd/UserControls/Widgets/TopSellingProductOfAllTimeCurrentWidget.ascx.cs b/MixERP.Net.FrontEnd/UserControls/Widgets/TopSellingProductOfAllTimeCurrentWidget.ascx.cs new file mode 100644 index 000000000..f85fc3bdc --- /dev/null +++ b/MixERP.Net.FrontEnd/UserControls/Widgets/TopSellingProductOfAllTimeCurrentWidget.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.Widgets +{ + public partial class TopSellingProductOfAllTimeCurrentWidget : 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/Widgets/TopSellingProductOfAllTimeCurrentWidget.ascx.designer.cs b/MixERP.Net.FrontEnd/UserControls/Widgets/TopSellingProductOfAllTimeCurrentWidget.ascx.designer.cs new file mode 100644 index 000000000..a16343ea6 --- /dev/null +++ b/MixERP.Net.FrontEnd/UserControls/Widgets/TopSellingProductOfAllTimeCurrentWidget.ascx.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.UserControls.Widgets { + + + public partial class TopSellingProductOfAllTimeCurrentWidget { + + /// + /// ctl023 control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.DataVisualization.Charting.Chart ctl023; + } +} diff --git a/MixERP.Net.FrontEnd/UserControls/Widgets/TopSellingProductOfAllTimetWidget.ascx b/MixERP.Net.FrontEnd/UserControls/Widgets/TopSellingProductOfAllTimetWidget.ascx new file mode 100644 index 000000000..a2a3e1cac --- /dev/null +++ b/MixERP.Net.FrontEnd/UserControls/Widgets/TopSellingProductOfAllTimetWidget.ascx @@ -0,0 +1,53 @@ +<%-- +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="TopSellingProductOfAllTimetWidget.ascx.cs" Inherits="MixERP.Net.FrontEnd.UserControls.Widgets.TopSellingProductOfAllTimetWidget" %> +
    +
    + Top 5 Selling Products of All Time(Todo: Same) +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    diff --git a/MixERP.Net.FrontEnd/UserControls/Widgets/TopSellingProductOfAllTimetWidget.ascx.cs b/MixERP.Net.FrontEnd/UserControls/Widgets/TopSellingProductOfAllTimetWidget.ascx.cs new file mode 100644 index 000000000..77a7861ed --- /dev/null +++ b/MixERP.Net.FrontEnd/UserControls/Widgets/TopSellingProductOfAllTimetWidget.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.Widgets +{ + public partial class TopSellingProductOfAllTimetWidget : 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/Widgets/TopSellingProductOfAllTimetWidget.ascx.designer.cs b/MixERP.Net.FrontEnd/UserControls/Widgets/TopSellingProductOfAllTimetWidget.ascx.designer.cs new file mode 100644 index 000000000..6aaae7006 --- /dev/null +++ b/MixERP.Net.FrontEnd/UserControls/Widgets/TopSellingProductOfAllTimetWidget.ascx.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.UserControls.Widgets { + + + public partial class TopSellingProductOfAllTimetWidget { + + /// + /// ctl02 control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.DataVisualization.Charting.Chart ctl02; + } +} diff --git a/MixERP.Net.FrontEnd/UserControls/Widgets/WorkflowWidget.ascx b/MixERP.Net.FrontEnd/UserControls/Widgets/WorkflowWidget.ascx new file mode 100644 index 000000000..cee54c520 --- /dev/null +++ b/MixERP.Net.FrontEnd/UserControls/Widgets/WorkflowWidget.ascx @@ -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/. +--%> +<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="WorkflowWidget.ascx.cs" Inherits="MixERP.Net.FrontEnd.UserControls.Widgets.WorkflowWidget" %> + diff --git a/MixERP.Net.FrontEnd/UserControls/Widgets/WorkflowWidget.ascx.cs b/MixERP.Net.FrontEnd/UserControls/Widgets/WorkflowWidget.ascx.cs new file mode 100644 index 000000000..46d6c4ac2 --- /dev/null +++ b/MixERP.Net.FrontEnd/UserControls/Widgets/WorkflowWidget.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.Widgets +{ + public partial class WorkflowWidget : 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/Widgets/WorkflowWidget.ascx.designer.cs b/MixERP.Net.FrontEnd/UserControls/Widgets/WorkflowWidget.ascx.designer.cs new file mode 100644 index 000000000..a9593a74f --- /dev/null +++ b/MixERP.Net.FrontEnd/UserControls/Widgets/WorkflowWidget.ascx.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.UserControls.Widgets { + + + public partial class WorkflowWidget { + } +} diff --git a/MixERP.Net.FrontEnd/Web.Debug.config b/MixERP.Net.FrontEnd/Web.Debug.config new file mode 100644 index 000000000..85749d5b8 --- /dev/null +++ b/MixERP.Net.FrontEnd/Web.Debug.config @@ -0,0 +1,39 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/MixERP.Net.FrontEnd/Web.Release.config b/MixERP.Net.FrontEnd/Web.Release.config new file mode 100644 index 000000000..6eb32e618 --- /dev/null +++ b/MixERP.Net.FrontEnd/Web.Release.config @@ -0,0 +1,40 @@ + + + + + + + + + + + + + + \ No newline at end of file diff --git a/MixERP.Net.FrontEnd/Web.config b/MixERP.Net.FrontEnd/Web.config new file mode 100644 index 000000000..358d659c2 --- /dev/null +++ b/MixERP.Net.FrontEnd/Web.config @@ -0,0 +1,91 @@ + + + + +
    +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/MixERP.Net.FrontEnd/db/en-US/mixerp-db-logic.sql b/MixERP.Net.FrontEnd/db/en-US/mixerp-db-logic.sql new file mode 100644 index 000000000..07f61d0d3 --- /dev/null +++ b/MixERP.Net.FrontEnd/db/en-US/mixerp-db-logic.sql @@ -0,0 +1,640 @@ + + + +DROP FUNCTION IF EXISTS office.can_login(user_id integer_strict, office_id integer_strict); +CREATE FUNCTION office.can_login(user_id integer_strict, office_id integer_strict) +RETURNS boolean +AS +$$ +DECLARE _office_id integer; +BEGIN + _office_id:=office.get_office_id_by_user_id($1); + + IF $1 = office.get_sys_user_id() THEN + RETURN false; + END IF; + + IF $2=_office_id THEN + RETURN true; + ELSE + IF office.is_parent_office(_office_id,$2) THEN + RETURN true; + END IF; + END IF; + RETURN false; +END; +$$ +LANGUAGE plpgsql; + + +DROP FUNCTION IF EXISTS office.sign_in(office_id integer_strict, user_name text, password text, browser text, ip_address text, remote_user text); +CREATE FUNCTION office.sign_in(office_id integer_strict, user_name text, password text, browser text, ip_address text, remote_user text) +RETURNS integer +AS +$$ +DECLARE _user_id integer; +DECLARE _lock_out_till TIMESTAMP; +BEGIN + _user_id:=office.get_user_id_by_user_name($2); + + IF _user_id IS NULL THEN + INSERT INTO audit.failed_logins(user_name,browser,ip_address,remote_user,details) + SELECT $2, $4, $5, $6, 'Invalid user name.'; + ELSE + _lock_out_till:=policy.is_locked_out_till(_user_id); + IF NOT ((_lock_out_till IS NOT NULL) AND (_lock_out_till>NOW())) THEN + IF office.validate_login($2,$3) THEN + IF office.can_login(_user_id,$1) THEN + INSERT INTO audit.logins(office_id,user_id,browser,ip_address,remote_user) + SELECT $1, _user_id, $4, $5, $6; + + RETURN CAST(currval('audit.logins_login_id_seq') AS integer); + ELSE + INSERT INTO audit.failed_logins(office_id,user_id,user_name,browser,ip_address,remote_user,details) + SELECT $1, _user_id, $2, $4, $5, $6, 'User from ' || office.get_office_name_by_id(office.get_office_id_by_user_id(_user_id)) || ' cannot login to ' || office.get_office_name_by_id($1) || '.'; + END IF; + ELSE + INSERT INTO audit.failed_logins(office_id,user_id,user_name,browser,ip_address,remote_user,details) + SELECT $1, _user_id, $2, $4, $5, $6, 'Invalid login attempt.'; + END IF; + END IF; + END IF; + + RETURN 0; +END +$$ +LANGUAGE plpgsql; + + + + +DROP FUNCTION IF EXISTS core.get_item_cost_price(item_id_ integer, party_id_ integer, unit_id_ integer); +CREATE FUNCTION core.get_item_cost_price(item_id_ integer, party_id_ integer, unit_id_ integer) +RETURNS money +AS +$$ + DECLARE _price money; + DECLARE _unit_id integer; + DECLARE _factor decimal; + DECLARE _tax_rate decimal; + DECLARE _includes_tax boolean; + DECLARE _tax money; +BEGIN + + --Fist pick the catalog price which matches all these fields: + --Item, Customer Type, Price Type, and Unit. + --This is the most effective price. + SELECT + item_cost_prices.price, + item_cost_prices.unit_id, + item_cost_prices.includes_tax + INTO + _price, + _unit_id, + _includes_tax + FROM core.item_cost_prices + WHERE item_cost_prices.item_id=$1 + AND item_cost_prices.party_id=$2 + AND item_cost_prices.unit_id = $3; + + IF(_unit_id IS NULL) THEN + --We do not have a cost price of this item for the unit supplied. + --Let's see if this item has a price for other units. + SELECT + item_cost_prices.price, + item_cost_prices.unit_id, + item_cost_prices.includes_tax + INTO + _price, + _unit_id, + _includes_tax + FROM core.item_cost_prices + WHERE item_cost_prices.item_id=$1 + AND item_cost_prices.party_id=$2; + END IF; + + + IF(_price IS NULL) THEN + --This item does not have cost price defined in the catalog. + --Therefore, getting the default cost price from the item definition. + SELECT + cost_price, + unit_id, + cost_price_includes_tax + INTO + _price, + _unit_id, + _includes_tax + FROM core.items + WHERE core.items.item_id = $1; + END IF; + + IF(_includes_tax) THEN + _tax_rate := core.get_item_tax_rate($1); + _price := _price / ((100 + _tax_rate)/ 100); + END IF; + + --Get the unitary conversion factor if the requested unit does not match with the price defition. + _factor := core.convert_unit($3, _unit_id); + + RETURN _price * _factor; +END +$$ +LANGUAGE plpgsql; + +DROP FUNCTION IF EXISTS core.get_item_selling_price(item_id_ integer, party_type_id_ integer, price_type_id_ integer, unit_id_ integer); +CREATE FUNCTION core.get_item_selling_price(item_id_ integer, party_type_id_ integer, price_type_id_ integer, unit_id_ integer) +RETURNS money +AS +$$ + DECLARE _price money; + DECLARE _unit_id integer; + DECLARE _factor decimal; + DECLARE _tax_rate decimal; + DECLARE _includes_tax boolean; + DECLARE _tax money; +BEGIN + + --Fist pick the catalog price which matches all these fields: + --Item, Customer Type, Price Type, and Unit. + --This is the most effective price. + SELECT + item_selling_prices.price, + item_selling_prices.unit_id, + item_selling_prices.includes_tax + INTO + _price, + _unit_id, + _includes_tax + FROM core.item_selling_prices + WHERE item_selling_prices.item_id=$1 + AND item_selling_prices.party_type_id=$2 + AND item_selling_prices.price_type_id =$3 + AND item_selling_prices.unit_id = $4; + + IF(_unit_id IS NULL) THEN + --We do not have a selling price of this item for the unit supplied. + --Let's see if this item has a price for other units. + SELECT + item_selling_prices.price, + item_selling_prices.unit_id, + item_selling_prices.includes_tax + INTO + _price, + _unit_id, + _includes_tax + FROM core.item_selling_prices + WHERE item_selling_prices.item_id=$1 + AND item_selling_prices.party_type_id=$2 + AND item_selling_prices.price_type_id =$3; + END IF; + + + IF(_price IS NULL) THEN + --This item does not have selling price defined in the catalog. + --Therefore, getting the default selling price from the item definition. + SELECT + selling_price, + unit_id, + selling_price_includes_tax + INTO + _price, + _unit_id, + _includes_tax + FROM core.items + WHERE core.items.item_id = $1; + END IF; + + IF(_includes_tax) THEN + _tax_rate := core.get_item_tax_rate($1); + _price := _price / ((100 + _tax_rate)/ 100); + END IF; + + --Get the unitary conversion factor if the requested unit does not match with the price defition. + _factor := core.convert_unit($4, _unit_id); + + RETURN _price * _factor; +END +$$ +LANGUAGE plpgsql; + +DROP FUNCTION IF EXISTS transactions.verification_trigger() CASCADE; +CREATE FUNCTION transactions.verification_trigger() +RETURNS TRIGGER +AS +$$ + DECLARE _transaction_master_id bigint; + DECLARE _transaction_posted_by integer; + DECLARE _old_verifier integer; + DECLARE _old_status integer; + DECLARE _old_reason national character varying(128); + DECLARE _verifier integer; + DECLARE _status integer; + DECLARE _reason national character varying(128); + DECLARE _has_policy boolean; + DECLARE _is_sys boolean; + DECLARE _rejected smallint=-3; + DECLARE _closed smallint=-2; + DECLARE _withdrawn smallint=-1; + DECLARE _unapproved smallint = 0; + DECLARE _auto_approved smallint = 1; + DECLARE _approved smallint=2; + DECLARE _book text; + DECLARE _can_verify_sales_transactions boolean; + DECLARE _sales_verification_limit money; + DECLARE _can_verify_purchase_transactions boolean; + DECLARE _purchase_verification_limit money; + DECLARE _can_verify_gl_transactions boolean; + DECLARE _gl_verification_limit money; + DECLARE _can_verify_self boolean; + DECLARE _self_verification_limit money; + DECLARE _posted_amount money; +BEGIN + IF TG_OP='DELETE' THEN + RAISE EXCEPTION 'Deleting a transaction is not allowed. Mark the transaction as rejected instead.'; + END IF; + + IF TG_OP='UPDATE' THEN + RAISE NOTICE 'Columns except the following will be ignored for this update: verified_by_user_id, verification_status_id, verification_reason.'; + + IF(OLD.transaction_master_id IS DISTINCT FROM NEW.transaction_master_id) THEN + RAISE EXCEPTION 'Cannot update the column "transaction_master_id".'; + END IF; + + IF(OLD.transaction_counter IS DISTINCT FROM NEW.transaction_counter) THEN + RAISE EXCEPTION 'Cannot update the column "transaction_counter".'; + END IF; + + IF(OLD.transaction_code IS DISTINCT FROM NEW.transaction_code) THEN + RAISE EXCEPTION 'Cannot update the column "transaction_code".'; + END IF; + + IF(OLD.book IS DISTINCT FROM NEW.book) THEN + RAISE EXCEPTION 'Cannot update the column "book".'; + END IF; + + IF(OLD.value_date IS DISTINCT FROM NEW.value_date) THEN + RAISE EXCEPTION 'Cannot update the column "value_date".'; + END IF; + + IF(OLD.transaction_ts IS DISTINCT FROM NEW.transaction_ts) THEN + RAISE EXCEPTION 'Cannot update the column "transaction_ts".'; + END IF; + + IF(OLD.login_id IS DISTINCT FROM NEW.login_id) THEN + RAISE EXCEPTION 'Cannot update the column "login_id".'; + END IF; + + IF(OLD.user_id IS DISTINCT FROM NEW.user_id) THEN + RAISE EXCEPTION 'Cannot update the column "user_id".'; + END IF; + + IF(OLD.sys_user_id IS DISTINCT FROM NEW.sys_user_id) THEN + RAISE EXCEPTION 'Cannot update the column "sys_user_id".'; + END IF; + + IF(OLD.office_id IS DISTINCT FROM NEW.office_id) THEN + RAISE EXCEPTION 'Cannot update the column "office_id".'; + END IF; + + IF(OLD.cost_center_id IS DISTINCT FROM NEW.cost_center_id) THEN + RAISE EXCEPTION 'Cannot update the column "cost_center_id".'; + END IF; + + _transaction_master_id := OLD.transaction_master_id; + _book := OLD.book; + _old_verifier := OLD.verified_by_user_id; + _old_status := OLD.verification_status_id; + _old_reason := OLD.verification_reason; + _transaction_posted_by := OLD.user_id; + _verifier := NEW.verified_by_user_id; + _status := NEW.verification_status_id; + _reason := NEW.verification_reason; + _is_sys := office.is_sys(_verifier); + + + SELECT + SUM(amount) + INTO + _posted_amount + FROM + transactions.transaction_details + WHERE transactions.transaction_details.transaction_master_id = _transaction_master_id + AND transactions.transaction_details.tran_type='Cr'; + + + SELECT + true, + can_verify_sales_transactions, + sales_verification_limit, + can_verify_purchase_transactions, + purchase_verification_limit, + can_verify_gl_transactions, + gl_verification_limit, + can_self_verify, + self_verification_limit + INTO + _has_policy, + _can_verify_sales_transactions, + _sales_verification_limit, + _can_verify_purchase_transactions, + _purchase_verification_limit, + _can_verify_gl_transactions, + _gl_verification_limit, + _can_verify_self, + _self_verification_limit + FROM + policy.voucher_verification_policy + WHERE user_id=_verifier + AND is_active=true + AND now() >= effective_from + AND now() <= ends_on; + + IF(_verifier IS NULL) THEN + RAISE EXCEPTION 'Access is denied.'; + END IF; + + IF(_status != _withdrawn AND _has_policy = false) THEN + RAISE EXCEPTION 'Access is denied. You don''t have the right to verify the transaction.'; + END IF; + + IF(_status = _withdrawn AND _has_policy = false) THEN + IF(_transaction_posted_by != _verifier) THEN + RAISE EXCEPTION 'Access is denied. You don''t have the right to withdraw the transaction.'; + END IF; + END IF; + + IF(_status = _auto_approved AND _is_sys = false) THEN + RAISE EXCEPTION 'Access is denied.'; + END IF; + + + IF(_has_policy = false) THEN + RAISE EXCEPTION 'Access is denied.'; + END IF; + + + --Is trying verify self transaction. + IF(NEW.verified_by_user_id = NEW.user_id) THEN + IF(_can_verify_self = false) THEN + RAISE EXCEPTION 'Please ask someone else to verify the transaction you posted.'; + END IF; + IF(_can_verify_self = true) THEN + IF(_posted_amount > _self_verification_limit AND _self_verification_limit > 0::money) THEN + RAISE EXCEPTION 'Self verfication limit exceeded. The transaction was not verified.'; + END IF; + END IF; + END IF; + + IF(lower(_book) LIKE '%sales%') THEN + IF(_can_verify_sales_transactions = false) THEN + RAISE EXCEPTION 'Access is denied.'; + END IF; + IF(_can_verify_sales_transactions = true) THEN + IF(_posted_amount > _sales_verification_limit AND _sales_verification_limit > 0::money) THEN + RAISE EXCEPTION 'Sales verfication limit exceeded. The transaction was not verified.'; + END IF; + END IF; + END IF; + + + IF(lower(_book) LIKE '%purchase%') THEN + IF(_can_verify_purchase_transactions = false) THEN + RAISE EXCEPTION 'Access is denied.'; + END IF; + IF(_can_verify_purchase_transactions = true) THEN + IF(_posted_amount > _purchase_verification_limit AND _purchase_verification_limit > 0::money) THEN + RAISE EXCEPTION 'Purchase verfication limit exceeded. The transaction was not verified.'; + END IF; + END IF; + END IF; + + + IF(lower(_book) LIKE 'journal%') THEN + IF(_can_verify_gl_transactions = false) THEN + RAISE EXCEPTION 'Access is denied.'; + END IF; + IF(_can_verify_gl_transactions = true) THEN + IF(_posted_amount > _gl_verification_limit AND _gl_verification_limit > 0::money) THEN + RAISE EXCEPTION 'GL verfication limit exceeded. The transaction was not verified.'; + END IF; + END IF; + END IF; + + NEW.last_verified_on := now(); + + END IF; + RETURN NEW; +END +$$ +LANGUAGE plpgsql; + + +CREATE TRIGGER verification_update_trigger +AFTER UPDATE +ON transactions.transaction_master +FOR EACH ROW +EXECUTE PROCEDURE transactions.verification_trigger(); + +CREATE TRIGGER verification_delete_trigger +BEFORE DELETE +ON transactions.transaction_master +FOR EACH ROW +EXECUTE PROCEDURE transactions.verification_trigger(); + + +DROP FUNCTION IF EXISTS transactions.auto_verify(bigint) CASCADE; + +CREATE FUNCTION transactions.auto_verify(bigint) +RETURNS VOID +AS +$$ + DECLARE _transaction_master_id bigint; + DECLARE _transaction_posted_by integer; + DECLARE _verifier integer; + DECLARE _status integer; + DECLARE _reason national character varying(128); + DECLARE _rejected smallint=-3; + DECLARE _closed smallint=-2; + DECLARE _withdrawn smallint=-1; + DECLARE _unapproved smallint = 0; + DECLARE _auto_approved smallint = 1; + DECLARE _approved smallint=2; + DECLARE _book text; + DECLARE _auto_verify_sales boolean; + DECLARE _sales_verification_limit money; + DECLARE _auto_verify_purchase boolean; + DECLARE _purchase_verification_limit money; + DECLARE _auto_verify_gl boolean; + DECLARE _gl_verification_limit money; + DECLARE _posted_amount money; + DECLARE _auto_verification boolean=true; + DECLARE _has_policy boolean=false; +BEGIN + _transaction_master_id := $1; + + SELECT + transactions.transaction_master.book, + transactions.transaction_master.user_id + INTO + _book, + _transaction_posted_by + FROM + transactions.transaction_master + WHERE transactions.transaction_master.transaction_master_id=_transaction_master_id; + + + _verifier := office.get_sys_user_id(); + _status := 2; + _reason := 'Automatically verified by workflow.'; + + SELECT + SUM(amount) + INTO + _posted_amount + FROM + transactions.transaction_details + WHERE transactions.transaction_details.transaction_master_id = _transaction_master_id + AND transactions.transaction_details.tran_type='Cr'; + + + SELECT + true, + verify_sales_transactions, + sales_verification_limit, + verify_purchase_transactions, + purchase_verification_limit, + verify_gl_transactions, + gl_verification_limit + INTO + _has_policy, + _auto_verify_sales, + _sales_verification_limit, + _auto_verify_purchase, + _purchase_verification_limit, + _auto_verify_gl, + _gl_verification_limit + FROM + policy.auto_verification_policy + WHERE user_id=_transaction_posted_by + AND is_active=true + AND now() >= effective_from + AND now() <= ends_on; + + + + IF(lower(_book) LIKE 'sales%') THEN + IF(_auto_verify_sales = false) THEN + _auto_verification := false; + END IF; + IF(_auto_verify_sales = true) THEN + IF(_posted_amount > _sales_verification_limit AND _sales_verification_limit > 0::money) THEN + _auto_verification := false; + END IF; + END IF; + END IF; + + + IF(lower(_book) LIKE 'purchase%') THEN + IF(_auto_verify_purchase = false) THEN + _auto_verification := false; + END IF; + IF(_auto_verify_purchase = true) THEN + IF(_posted_amount > _purchase_verification_limit AND _purchase_verification_limit > 0::money) THEN + _auto_verification := false; + END IF; + END IF; + END IF; + + + IF(lower(_book) LIKE 'journal%') THEN + IF(_auto_verify_gl = false) THEN + _auto_verification := false; + END IF; + IF(_auto_verify_gl = true) THEN + IF(_posted_amount > _gl_verification_limit AND _gl_verification_limit > 0::money) THEN + _auto_verification := false; + END IF; + END IF; + END IF; + + IF(_has_policy=true) THEN + IF(_auto_verification = true) THEN + UPDATE transactions.transaction_master + SET + last_verified_on = now(), + verified_by_user_id=_verifier, + verification_status_id=_status, + verification_reason=_reason + WHERE + transactions.transaction_master.transaction_master_id=_transaction_master_id; + END IF; + ELSE + RAISE NOTICE 'No auto verification policy found for this user.'; + END IF; +RETURN; +END +$$ +LANGUAGE plpgsql; + +DROP VIEW IF EXISTS transactions.verified_transactions_view; +DROP VIEW IF EXISTS transactions.transaction_view; +CREATE VIEW transactions.transaction_view +AS +SELECT + transactions.transaction_master.transaction_master_id, + transactions.transaction_master.transaction_counter, + transactions.transaction_master.transaction_code, + transactions.transaction_master.book, + transactions.transaction_master.value_date, + transactions.transaction_master.transaction_ts, + transactions.transaction_master.login_id, + transactions.transaction_master.user_id, + transactions.transaction_master.sys_user_id, + transactions.transaction_master.office_id, + transactions.transaction_master.cost_center_id, + transactions.transaction_master.reference_number, + transactions.transaction_master.statement_reference AS master_statement_reference, + transactions.transaction_master.last_verified_on, + transactions.transaction_master.verified_by_user_id, + transactions.transaction_master.verification_status_id, + transactions.transaction_master.verification_reason, + transactions.transaction_details.transaction_detail_id, + transactions.transaction_details.tran_type, + transactions.transaction_details.account_id, + transactions.transaction_details.statement_reference, + transactions.transaction_details.cash_repository_id, + transactions.transaction_details.amount +FROM +transactions.transaction_master +INNER JOIN transactions.transaction_details +ON transactions.transaction_master.transaction_master_id = transactions.transaction_details.transaction_master_id; + +CREATE VIEW transactions.verified_transactions_view +AS +SELECT * FROM transactions.transaction_view +WHERE verification_status_id > 0; + + +DROP FUNCTION IF EXISTS transactions.get_cash_repository_balance(integer); +CREATE FUNCTION transactions.get_cash_repository_balance(integer) +RETURNS money +AS +$$ + DECLARE _debit money; + DECLARE _credit money; +BEGIN + SELECT COALESCE(SUM(amount), 0::money) INTO _debit + FROM transactions.verified_transactions_view + WHERE cash_repository_id=$1 + AND tran_type='Dr'; + + SELECT COALESCE(SUM(amount), 0::money) INTO _credit + FROM transactions.verified_transactions_view + WHERE cash_repository_id=$1 + AND tran_type='Cr'; + + RETURN _debit - _credit; +END +$$ +LANGUAGE plpgsql; diff --git a/MixERP.Net.FrontEnd/db/en-US/mixerp.bak.sql b/MixERP.Net.FrontEnd/db/en-US/mixerp.bak.sql new file mode 100644 index 000000000..8824b3fbe --- /dev/null +++ b/MixERP.Net.FrontEnd/db/en-US/mixerp.bak.sql @@ -0,0 +1,3588 @@ +/******************************************************************************** +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/. +***********************************************************************************/ + +/******************************************************************************** + NOTE: ALL RANDOM INDEXES ARE REMOVED FROM THE SCRIPT. + TODO LIST : NEED TO CREATE INDEXES. +***********************************************************************************/ + +DROP SCHEMA IF EXISTS audit CASCADE; +DROP SCHEMA IF EXISTS core CASCADE; +DROP SCHEMA IF EXISTS office CASCADE; +DROP SCHEMA IF EXISTS policy CASCADE; +DROP SCHEMA IF EXISTS transactions CASCADE; +DROP SCHEMA IF EXISTS crm CASCADE; +DROP SCHEMA IF EXISTS mrp CASCADE; + +CREATE SCHEMA audit; +CREATE SCHEMA core; +CREATE SCHEMA office; +CREATE SCHEMA policy; +CREATE SCHEMA transactions; +CREATE SCHEMA crm; +CREATE SCHEMA mrp; + + +CREATE TABLE core.verification_statuses +( + verification_status_id smallint NOT NULL PRIMARY KEY, + verification_status_name national character varying(128) NOT NULL +); + +CREATE UNIQUE INDEX verification_statuses_verification_status_name_uix +ON core.verification_statuses(UPPER(verification_status_name)); + + +--These are hardcoded values and therefore the meanings should always remain intact +--regardless of the language. +INSERT INTO core.verification_statuses +SELECT -3, 'Rejected' UNION ALL +SELECT -2, 'Closed' UNION ALL +SELECT -1, 'Withdrawn' UNION ALL +SELECT 0, 'Unverified' UNION ALL +SELECT 1, 'Automatically Approved by Workflow' UNION ALL +SELECT 2, 'Approved'; + +DROP DOMAIN IF EXISTS transaction_type; +CREATE DOMAIN transaction_type +AS char(2) +CHECK +( + VALUE IN + ( + 'Dr', --Debit + 'Cr' --Credit + ) +); + +/******************************************************************* + MIXERP STRICT Data Types: NEGATIVES ARE NOT ALLOWED +*******************************************************************/ + +DROP DOMAIN IF EXISTS money_strict; +CREATE DOMAIN money_strict +AS money +CHECK +( + VALUE > '0' +); + + +DROP DOMAIN IF EXISTS money_strict2; +CREATE DOMAIN money_strict2 +AS money +CHECK +( + VALUE >= '0' +); + +DROP DOMAIN IF EXISTS integer_strict; +CREATE DOMAIN integer_strict +AS integer +CHECK +( + VALUE > 0 +); + +DROP DOMAIN IF EXISTS integer_strict2; +CREATE DOMAIN integer_strict2 +AS integer +CHECK +( + VALUE >= 0 +); + +DROP DOMAIN IF EXISTS smallint_strict; +CREATE DOMAIN smallint_strict +AS smallint +CHECK +( + VALUE > 0 +); + +DROP DOMAIN IF EXISTS smallint_strict2; +CREATE DOMAIN smallint_strict2 +AS smallint +CHECK +( + VALUE >= 0 +); + +DROP DOMAIN IF EXISTS decimal_strict; +CREATE DOMAIN decimal_strict +AS decimal +CHECK +( + VALUE > 0 +); + +DROP VIEW IF EXISTS db_stat; +CREATE VIEW db_stat +AS +select + relname, + last_vacuum, + last_autovacuum, + last_analyze, + last_autoanalyze, + vacuum_count, + autovacuum_count, + analyze_count, + autoanalyze_count +from + pg_stat_user_tables; + +DROP DOMAIN IF EXISTS decimal_strict2; +CREATE DOMAIN decimal_strict2 +AS decimal +CHECK +( + VALUE >= 0 +); + +DROP DOMAIN IF EXISTS image_path; +CREATE DOMAIN image_path +AS text; + + + +CREATE TABLE office.users +( + user_id SERIAL NOT NULL PRIMARY KEY, + role_id smallint NOT NULL, + office_id integer NOT NULL, + user_name national character varying(50) NOT NULL, + full_name national character varying(100) NOT NULL, + password text NOT NULL, + audit_user_id integer NULL REFERENCES office.users(user_id), + audit_ts TIMESTAMP WITH TIME ZONE NULL DEFAULT(NOW()) +); + +CREATE TABLE core.currencies +( + currency_code national character varying(12) NOT NULL PRIMARY KEY, + currency_symbol national character varying(12) NOT NULL, + currency_name national character varying(48) NOT NULL UNIQUE, + hundredth_name national character varying(48) NOT NULL, + audit_user_id integer NULL REFERENCES office.users(user_id), + audit_ts TIMESTAMP WITH TIME ZONE NULL DEFAULT(NOW()) +); + +INSERT INTO core.currencies +SELECT 'NPR', 'Rs.', 'Nepali Rupees', 'paisa' UNION ALL +SELECT 'USD', '$ ', 'United States Dollar', 'cents'; + +CREATE FUNCTION office.is_parent_office(child integer_strict, parent integer_strict) +RETURNS boolean +AS +$$ +BEGIN + IF $1!=$2 THEN + IF EXISTS + ( + WITH RECURSIVE office_cte(office_id, path) AS ( + SELECT + tn.office_id, tn.office_id::TEXT AS path + FROM office.offices AS tn WHERE tn.parent_office_id IS NULL + UNION ALL + SELECT + c.office_id, (p.path || '->' || c.office_id::TEXT) + FROM office_cte AS p, office.offices AS c WHERE parent_office_id = p.office_id + ) + SELECT * FROM + ( + SELECT regexp_split_to_table(path, '->') + FROM office_cte AS n WHERE n.office_id = $2 + ) AS items + WHERE regexp_split_to_table=$1::text + ) THEN + RETURN TRUE; + END IF; + END IF; + RETURN false; +END +$$ +LANGUAGE plpgsql; + +CREATE TABLE office.offices +( + office_id SERIAL NOT NULL PRIMARY KEY, + office_code national character varying(12) NOT NULL, + office_name national character varying(150) NOT NULL, + nick_name national character varying(50) NULL, + registration_date date NOT NULL, + currency_code national character varying(12) NOT NULL + CONSTRAINT offices_currencies_fk REFERENCES core.currencies(currency_code) + CONSTRAINT offices_currency_code_df DEFAULT('NPR'), + address_line_1 national character varying(128) NULL, + address_line_2 national character varying(128) NULL, + street national character varying(50) NULL, + city national character varying(50) NULL, + state national character varying(50) NULL, + country national character varying(50) NULL, + zip_code national character varying(24) NULL, + phone national character varying(24) NULL, + fax national character varying(24) NULL, + email national character varying(128) NULL, + url national character varying(50) NULL, + registration_number national character varying(24) NULL, + pan_number national character varying(24) NULL, + audit_user_id integer NULL REFERENCES office.users(user_id), + audit_ts TIMESTAMP WITH TIME ZONE NULL DEFAULT(NOW()), + parent_office_id integer NULL REFERENCES office.offices(office_id) + CHECK + ( + office.is_parent_office(office_id, parent_office_id) = FALSE + AND + parent_office_id != office_id + ) +); + +ALTER TABLE office.users +ADD FOREIGN KEY(office_id) REFERENCES office.offices(office_id); + +CREATE UNIQUE INDEX offices_office_code_uix +ON office.offices(UPPER(office_code)); + +CREATE UNIQUE INDEX offices_office_name_uix +ON office.offices(UPPER(office_name)); + +CREATE UNIQUE INDEX offices_nick_name_uix +ON office.offices(UPPER(nick_name)); + + +/******************************************************************* + SAMPLE DATA FEED + TODO: REMOVE THE BELOW BEFORE RELEASE +*******************************************************************/ + +INSERT INTO office.offices(office_code,office_name,nick_name,registration_date, street,city,state,country,zip_code,phone,fax,email,url,registration_number,pan_number) +SELECT 'PES','Planet Earth Solutions', 'PES Technologies', '06/06/1989', 'Brooklyn','NY','','US','','','','info@planetearthsolution.com','http://planetearthsolution.com','0','0'; + + +INSERT INTO office.offices(office_code,office_name,nick_name, registration_date, street,city,state,country,zip_code,phone,fax,email,url,registration_number,pan_number,parent_office_id) +SELECT 'PES-NY-BK','Brooklyn Branch', 'PES Brooklyn', '06/06/1989', 'Brooklyn','NY','12345555','','','','','info@planetearthsolution.com','http://planetearthsolution.com','0','0',(SELECT office_id FROM office.offices WHERE office_code='PES'); + +INSERT INTO office.offices(office_code,office_name,nick_name, registration_date, street,city,state,country,zip_code,phone,fax,email,url,registration_number,pan_number,parent_office_id) +SELECT 'PES-NY-MEM','Memphis Branch', 'PES Memphis', '06/06/1989', 'Memphis', 'NY','','','','64464554','','info@planetearthsolution.com','http://planetearthsolution.com','0','0',(SELECT office_id FROM office.offices WHERE office_code='PES'); + + +/******************************************************************* + RETURNS MINI OFFICE TABLE +*******************************************************************/ + +CREATE TYPE office.office_type AS +( + office_id integer_strict, + office_code national character varying(12), + office_name national character varying(150), + address text +); + +CREATE FUNCTION office.get_offices() +RETURNS setof office.office_type +AS +$$ +DECLARE "@record" office.office_type%rowtype; +BEGIN + FOR "@record" IN SELECT office_id, office_code,office_name,street || ' ' || city AS Address FROM office.offices WHERE parent_office_id IS NOT NULL + LOOP + RETURN NEXT "@record"; + END LOOP; + + IF NOT FOUND THEN + FOR "@record" IN SELECT office_id, office_code,office_name,street || ' ' || city AS Address FROM office.offices WHERE parent_office_id IS NULL + LOOP + RETURN NEXT "@record"; + END LOOP; + END IF; + + RETURN; +END +$$ +LANGUAGE plpgsql; + + +CREATE FUNCTION office.get_office_name_by_id(office_id integer_strict) +RETURNS text +AS +$$ +BEGIN + RETURN + ( + SELECT office.offices.office_name FROM office.offices + WHERE office.offices.office_id=$1 + ); +END +$$ +LANGUAGE plpgsql; + + +--TODO +CREATE VIEW office.office_view +AS +SELECT * FROM office.offices; + +CREATE TABLE office.departments +( + department_id SERIAL NOT NULL PRIMARY KEY, + department_code national character varying(12) NOT NULL, + department_name national character varying(50) NOT NULL, + audit_user_id integer NULL REFERENCES office.users(user_id), + audit_ts TIMESTAMP WITH TIME ZONE NULL DEFAULT(NOW()) +); + + +CREATE UNIQUE INDEX departments_department_code_uix +ON office.departments(UPPER(department_code)); + +CREATE UNIQUE INDEX departments_department_name_uix +ON office.departments(UPPER(department_name)); + + +INSERT INTO office.departments(department_code, department_name) +SELECT 'SAL', 'Sales & Billing' UNION ALL +SELECT 'MKT', 'Marketing & Promotion' UNION ALL +SELECT 'SUP', 'Support' UNION ALL +SELECT 'CC', 'Customer Care'; + + +CREATE TABLE office.roles +( + role_id SERIAL NOT NULL PRIMARY KEY, + role_code national character varying(12) NOT NULL, + role_name national character varying(50) NOT NULL, + is_admin boolean NOT NULL CONSTRAINT roles_is_admin_df DEFAULT(false), + is_system boolean NOT NULL CONSTRAINT roles_is_system_df DEFAULT(false), + audit_user_id integer NULL REFERENCES office.users(user_id), + audit_ts TIMESTAMP WITH TIME ZONE NULL DEFAULT(NOW()) +); + +ALTER TABLE office.users +ADD FOREIGN KEY(role_id) REFERENCES office.roles(role_id); + + +CREATE UNIQUE INDEX roles_role_code_uix +ON office.roles(UPPER(role_code)); + +CREATE UNIQUE INDEX roles_role_name_uix +ON office.roles(UPPER(role_name)); + +INSERT INTO office.roles(role_code,role_name, is_system) +SELECT 'SYST', 'System', true; + +INSERT INTO office.roles(role_code,role_name, is_admin) +SELECT 'ADMN', 'Administrators', true; + +INSERT INTO office.roles(role_code,role_name) +SELECT 'USER', 'Users' UNION ALL +SELECT 'EXEC', 'Executive' UNION ALL +SELECT 'MNGR', 'Manager' UNION ALL +SELECT 'SALE', 'Sales' UNION ALL +SELECT 'MARK', 'Marketing' UNION ALL +SELECT 'LEGL', 'Legal & Compliance' UNION ALL +SELECT 'FINC', 'Finance' UNION ALL +SELECT 'HUMR', 'Human Resources' UNION ALL +SELECT 'INFO', 'Information Technology' UNION ALL +SELECT 'CUST', 'Customer Service'; + + + +CREATE FUNCTION office.get_office_id_by_user_id(user_id integer_strict) +RETURNS integer +AS +$$ +BEGIN + RETURN + ( + SELECT office.users.office_id FROM office.users + WHERE office.users.user_id=$1 + ); +END +$$ +LANGUAGE plpgsql; + +CREATE FUNCTION office.get_office_id_by_office_code(office_code text) +RETURNS integer +AS +$$ +BEGIN + RETURN + ( + SELECT office.offices.office_id FROM office.offices + WHERE office.offices.office_code=$1 + ); +END +$$ +LANGUAGE plpgsql; + +CREATE FUNCTION office.get_user_id_by_user_name(user_name text) +RETURNS integer +AS +$$ +BEGIN + RETURN + ( + SELECT office.users.user_id FROM office.users + WHERE office.users.user_name=$1 + ); +END +$$ +LANGUAGE plpgsql; + +CREATE FUNCTION office.get_user_name_by_user_id(user_id integer) +RETURNS text +AS +$$ +BEGIN + RETURN + ( + SELECT office.users.user_name FROM office.users + WHERE office.users.user_id=$1 + ); +END +$$ +LANGUAGE plpgsql; + +CREATE FUNCTION office.get_role_id_by_use_id(user_id integer_strict) +RETURNS integer +AS +$$ +BEGIN + RETURN + ( + SELECT office.users.role_id FROM office.users + WHERE office.users.user_id=$1 + ); +END +$$ +LANGUAGE plpgsql; + + +CREATE FUNCTION office.get_role_code_by_user_name(user_name text) +RETURNS text +AS +$$ +BEGIN + RETURN + ( + SELECT office.roles.role_code FROM office.roles, office.users + WHERE office.roles.role_id=office.users.role_id + AND office.users.user_name=$1 + ); +END +$$ +LANGUAGE plpgsql; + +CREATE VIEW office.user_view +AS +SELECT + office.users.user_id, + office.users.user_name, + office.users.full_name, + office.roles.role_name, + office.offices.office_name +FROM + office.users +INNER JOIN office.roles +ON office.users.role_id = office.roles.role_id +INNER JOIN office.offices +ON office.users.office_id = office.offices.office_id; + +CREATE FUNCTION office.get_sys_user_id() +RETURNS integer +AS +$$ +BEGIN + RETURN + ( + SELECT office.users.user_id + FROM office.roles, office.users + WHERE office.roles.role_id = office.users.role_id + AND office.roles.is_system=true LIMIT 1 + ); +END +$$ +LANGUAGE plpgsql; + + + +CREATE FUNCTION office.create_user +( + role_id integer_strict, + office_id integer_strict, + user_name text, + password text, + full_name text +) +RETURNS VOID +AS +$$ +BEGIN + INSERT INTO office.users(role_id,office_id,user_name,password, full_name) + SELECT $1, $2, $3, $4,$5; + RETURN; +END +$$ +LANGUAGE plpgsql; + + +SELECT office.create_user((SELECT role_id FROM office.roles WHERE role_code='SYST'),(SELECT office_id FROM office.offices WHERE office_code='PES'),'sys','','System'); + +/******************************************************************* + TODO: REMOVE THIS USER ON DEPLOYMENT +*******************************************************************/ +SELECT office.create_user((SELECT role_id FROM office.roles WHERE role_code='ADMN'),(SELECT office_id FROM office.offices WHERE office_code='PES'),'binod','+qJ9AMyGgrX/AOF4GmwmBa4SrA3+InlErVkJYmAopVZh+WFJD7k2ZO9dxox6XiqT38dSoM72jLoXNzwvY7JAQA==','Binod Nepal'); + +CREATE FUNCTION office.validate_login +( + user_name text, + password text +) +RETURNS boolean +AS +$$ +BEGIN + IF EXISTS + ( + SELECT 1 FROM office.users + WHERE office.users.user_name=$1 + AND office.users.password=$2 + --The system user should not be allowed to login. + AND office.users.role_id != + ( + SELECT office.roles.role_id + FROM office.roles + WHERE office.roles.role_code='SYST' + ) + ) THEN + RETURN true; + END IF; + RETURN false; +END +$$ +LANGUAGE plpgsql; + + + +CREATE UNIQUE INDEX users_user_name_uix +ON office.users(UPPER(user_name)); + + +CREATE TABLE audit.logins +( + login_id BIGSERIAL NOT NULL PRIMARY KEY, + user_id integer NOT NULL REFERENCES office.users(user_id), + office_id integer NOT NULL REFERENCES office.offices(office_id), + browser national character varying(500) NOT NULL, + ip_address national character varying(50) NOT NULL, + login_date_time TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT(now()), + remote_user national character varying(50) NOT NULL +); + +CREATE FUNCTION office.get_login_id(_user_id integer) +RETURNS bigint +AS +$$ +BEGIN + RETURN + ( + SELECT login_id + FROM audit.logins + WHERE user_id=$1 + AND login_date_time = + ( + SELECT MAX(login_date_time) + FROM audit.logins + WHERE user_id=$1 + ) + ); +END +$$ +LANGUAGE plpgsql; + +CREATE FUNCTION office.get_logged_in_office_id(_user_id integer) +RETURNS integer +AS +$$ +BEGIN + RETURN + ( + SELECT office_id + FROM audit.logins + WHERE user_id=$1 + AND login_date_time = + ( + SELECT MAX(login_date_time) + FROM audit.logins + WHERE user_id=$1 + ) + ); +END +$$ +LANGUAGE plpgsql; + +CREATE TABLE audit.failed_logins +( + failed_login_id BIGSERIAL NOT NULL PRIMARY KEY, + user_id integer NULL REFERENCES office.users(user_id), + user_name national character varying(50) NOT NULL, + office_id integer NOT NULL REFERENCES office.offices(office_id), + browser national character varying(500) NOT NULL, + ip_address national character varying(50) NOT NULL, + failed_date_time TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT(now()), + remote_user national character varying(50) NOT NULL, + details national character varying(250) NULL +); + + +CREATE TABLE policy.lock_outs +( + lock_out_id BIGSERIAL NOT NULL PRIMARY KEY, + user_id integer NOT NULL REFERENCES office.users(user_id), + lock_out_time TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT(NOW()), + lock_out_till TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT(NOW() + '5 minutes'::interval) +); + +--TODO: Create a lockout policy. +CREATE FUNCTION policy.perform_lock_out() +RETURNS TRIGGER +AS +$$ +BEGIN + IF( + SELECT COUNT(*) FROM audit.failed_logins + WHERE audit.failed_logins.user_id=NEW.user_id + AND audit.failed_logins.failed_date_time + BETWEEN NOW()-'5minutes'::interval + AND NOW() + )::integer>5 THEN + + INSERT INTO policy.lock_outs(user_id)SELECT NEW.user_id; +END IF; +RETURN NEW; +END +$$ +LANGUAGE plpgsql; + +CREATE TRIGGER lockout_user +AFTER INSERT +ON audit.failed_logins +FOR EACH ROW EXECUTE PROCEDURE policy.perform_lock_out(); + +CREATE FUNCTION policy.is_locked_out_till(user_id integer_strict) +RETURNS TIMESTAMP +AS +$$ +BEGIN + RETURN + ( + SELECT MAX(policy.lock_outs.lock_out_till)::TIMESTAMP WITHOUT TIME ZONE FROM policy.lock_outs + WHERE policy.lock_outs.user_id=$1 + ); +END +$$ +LANGUAGE plpgsql; + + + +CREATE TABLE core.price_types +( + price_type_id SERIAL NOT NULL PRIMARY KEY, + price_type_code national character varying(12) NOT NULL, + price_type_name national character varying(50) NOT NULL, + audit_user_id integer NULL REFERENCES office.users(user_id), + audit_ts TIMESTAMP WITH TIME ZONE NULL DEFAULT(NOW()) +); + + +CREATE UNIQUE INDEX price_types_price_type_code_uix +ON core.price_types(UPPER(price_type_code)); + +CREATE UNIQUE INDEX price_types_price_type_name_uix +ON core.price_types(UPPER(price_type_name)); + + +INSERT INTO core.price_types(price_type_code, price_type_name) +SELECT 'RET', 'Retail' UNION ALL +SELECT 'WHO', 'Wholesale'; + + + +CREATE TABLE core.menus +( + menu_id SERIAL NOT NULL PRIMARY KEY, + menu_text national character varying(250) NOT NULL, + url national character varying(250) NULL, + menu_code national character varying(12) NOT NULL, + level smallint NOT NULL, + parent_menu_id integer NULL REFERENCES core.menus(menu_id), + audit_user_id integer NULL REFERENCES office.users(user_id), + audit_ts TIMESTAMP WITH TIME ZONE NULL DEFAULT(NOW()) +); + +CREATE UNIQUE INDEX menus_menu_code_uix +ON core.menus(UPPER(menu_code)); + +CREATE FUNCTION core.get_menu_id(menu_code text) +RETURNS INTEGER +AS +$$ +BEGIN + RETURN + ( + SELECT core.menus.menu_id + FROM core.menus + WHERE core.menus.menu_code=$1 + ); +END +$$ +LANGUAGE plpgsql; + + + +CREATE FUNCTION core.get_root_parent_menu_id(text) +RETURNS integer +AS +$$ + DECLARE retVal integer; +BEGIN + WITH RECURSIVE find_parent(menu_id_group, parent, parent_menu_id, recentness) AS + ( + SELECT menu_id, menu_id, parent_menu_id, 0 + FROM core.menus + WHERE url=$1 + UNION ALL + SELECT fp.menu_id_group, i.menu_id, i.parent_menu_id, fp.recentness + 1 + FROM core.menus i + JOIN find_parent fp ON i.menu_id = fp.parent_menu_id + ) + + SELECT parent INTO retVal + FROM find_parent q + JOIN + ( + SELECT menu_id_group, MAX(recentness) AS answer + FROM find_parent + GROUP BY menu_id_group + ) AS ans ON q.menu_id_group = ans.menu_id_group AND q.recentness = ans.answer + ORDER BY q.menu_id_group; + + RETURN retVal; +END +$$ +LANGUAGE plpgsql; + + +INSERT INTO core.menus(menu_text, url, menu_code, level) +SELECT 'Dashboard', '/Dashboard/Index.aspx', 'DB', 0 UNION ALL +SELECT 'Sales', '/Sales/Index.aspx', 'SA', 0 UNION ALL +SELECT 'Purchase', '/Purchase/Index.aspx', 'PU', 0 UNION ALL +SELECT 'Products & Items', '/Items/Index.aspx', 'ITM', 0 UNION ALL +SELECT 'Finance', '/Finance/Index.aspx', 'FI', 0 UNION ALL +SELECT 'Manufacturing', '/Manufacturing/Index.aspx', 'MF', 0 UNION ALL +SELECT 'CRM', '/CRM/Index.aspx', 'CRM', 0 UNION ALL +SELECT 'Setup Parameters', '/Setup/Index.aspx', 'SE', 0 UNION ALL +SELECT 'POS', '/POS/Index.aspx', 'POS', 0; + + +INSERT INTO core.menus(menu_text, url, menu_code, level, parent_menu_id) + SELECT 'Sales & Quotation', NULL, 'SAQ', 1, core.get_menu_id('SA') +UNION ALL SELECT 'Direct Sales', '/Sales/DirectSales.aspx', 'DRS', 2, core.get_menu_id('SAQ') +UNION ALL SELECT 'Sales Quotation', '/Sales/Quotation.aspx', 'SQ', 2, core.get_menu_id('SAQ') +UNION ALL SELECT 'Sales Order', '/Sales/Order.aspx', 'SO', 2, core.get_menu_id('SAQ') +UNION ALL SELECT 'Delivery for Sales Order', '/Sales/DeliveryForOrder.aspx', 'DSO', 2, core.get_menu_id('SAQ') +UNION ALL SELECT 'Delivery Without Sales Order', '/Sales/DeliveryWithoutOrder.aspx', 'DWO', 2, core.get_menu_id('SAQ') +UNION ALL SELECT 'Invoice for Sales Delivery', '/Sales/Invoice.aspx', 'ISD', 2, core.get_menu_id('SAQ') +UNION ALL SELECT 'Receipt from Customer', '/Sales/Receipt.aspx', 'RFC', 2, core.get_menu_id('SAQ') +UNION ALL SELECT 'Sales Return', '/Sales/Return.aspx', 'SR', 2, core.get_menu_id('SAQ') +UNION ALL SELECT 'Setup & Maintenance', NULL, 'SSM', 1, core.get_menu_id('SA') +UNION ALL SELECT 'Bonus Slab for Agents', '/Sales/Setup/AgentBonusSlabs.aspx', 'ABS', 2, core.get_menu_id('SSM') +UNION ALL SELECT 'Bonus Slab Details', '/Sales/Setup/AgentBonusSlabDetails.aspx', 'BSD', 2, core.get_menu_id('SSM') +UNION ALL SELECT 'Sales Agents', '/Sales/Setup/Agents.aspx', 'SSA', 2, core.get_menu_id('SSM') +UNION ALL SELECT 'Bonus Slab Assignment', '/Sales/Setup/BonusSlabAssignment.aspx', 'BSA', 2, core.get_menu_id('SSM') +UNION ALL SELECT 'Sales Reports', NULL, 'SAR', 1, core.get_menu_id('SA') +UNION ALL SELECT 'View Sales Inovice', '/Reports/Sales.View.Sales.Invoice.xml', 'SAR-SVSI', 2, core.get_menu_id('SAR') +UNION ALL SELECT 'Cashier Management', NULL, 'CM', 1, core.get_menu_id('POS') +UNION ALL SELECT 'Assign Cashier', '/POS/AssignCashier.aspx', 'ASC', 2, core.get_menu_id('CM') +UNION ALL SELECT 'POS Setup', NULL, 'POSS', 1, core.get_menu_id('POS') +UNION ALL SELECT 'Store Types', '/POS/Setup/StoreTypes.aspx', 'STT', 2, core.get_menu_id('POSS') +UNION ALL SELECT 'Stores', '/POS/Setup/Stores.aspx', 'STO', 2, core.get_menu_id('POSS') +UNION ALL SELECT 'Cash Repository Setup', '/Setup/CashRepositories.aspx', 'SCR', 2, core.get_menu_id('POSS') +UNION ALL SELECT 'Counter Setup', '/Setup/Counters.aspx', 'SCS', 2, core.get_menu_id('POSS') +UNION ALL SELECT 'Purchase & Quotation', NULL, 'PUQ', 1, core.get_menu_id('PU') +UNION ALL SELECT 'Direct Purchase', '/Purchase/DirectPurchase.aspx', 'DRP', 2, core.get_menu_id('PUQ') +UNION ALL SELECT 'Purchase Order', '/Purchase/Order.aspx', 'PO', 2, core.get_menu_id('PUQ') +UNION ALL SELECT 'GRN against PO', '/Purchase/GRN.aspx', 'GRN', 2, core.get_menu_id('PUQ') +UNION ALL SELECT 'Purchase Invoice Against GRN', '/Purchase/Invoice.aspx', 'PAY', 2, core.get_menu_id('PUQ') +UNION ALL SELECT 'Payment to Supplier', '/Purchase/Payment.aspx', 'PAS', 2, core.get_menu_id('PUQ') +UNION ALL SELECT 'Purchase Return', '/Purchase/Return.aspx', 'PR', 2, core.get_menu_id('PUQ') +UNION ALL SELECT 'Purchase Reports', NULL, 'PUR', 1, core.get_menu_id('PU') +UNION ALL SELECT 'Inventory Movements', NULL, 'IIM', 1, core.get_menu_id('ITM') +UNION ALL SELECT 'Stock Transfer Journal', '/Items/Transfer.aspx', 'STJ', 2, core.get_menu_id('IIM') +UNION ALL SELECT 'Stock Adjustments', '/Items/Adjustment.aspx', 'STA', 2, core.get_menu_id('IIM') +UNION ALL SELECT 'Setup & Maintenance', NULL, 'ISM', 1, core.get_menu_id('ITM') +UNION ALL SELECT 'Party Types', '/Items/Setup/PartyTypes.aspx', 'PT', 2, core.get_menu_id('ISM') +UNION ALL SELECT 'Party Accounts', '/Items/Setup/Parties.aspx', 'PA', 2, core.get_menu_id('ISM') +UNION ALL SELECT 'Shipping Addresses', '/Items/Setup/ShippingAddresses.aspx', 'PSA', 2, core.get_menu_id('ISM') +UNION ALL SELECT 'Item Maintenance', '/Items/Setup/Items.aspx', 'SSI', 2, core.get_menu_id('ISM') +UNION ALL SELECT 'Cost Prices', '/Items/Setup/CostPrices.aspx', 'ICP', 2, core.get_menu_id('ISM') +UNION ALL SELECT 'Selling Prices', '/Items/Setup/SellingPrices.aspx', 'ISP', 2, core.get_menu_id('ISM') +UNION ALL SELECT 'Item Groups', '/Items/Setup/ItemGroups.aspx', 'SSG', 2, core.get_menu_id('ISM') +UNION ALL SELECT 'Brands', '/Items/Setup/Brands.aspx', 'SSB', 2, core.get_menu_id('ISM') +UNION ALL SELECT 'Units of Measure', '/Items/Setup/UOM.aspx', 'UOM', 2, core.get_menu_id('ISM') +UNION ALL SELECT 'Compound Units of Measure', '/Items/Setup/CUOM.aspx', 'CUOM', 2, core.get_menu_id('ISM') +UNION ALL SELECT 'Shipper Information', '/Items/Setup/Shipper.aspx', 'SHI', 2, core.get_menu_id('ISM') +UNION ALL SELECT 'Transactions & Templates', NULL, 'FTT', 1, core.get_menu_id('FI') +UNION ALL SELECT 'Journal Voucher Entry', '/Finance/JournalVoucher.aspx', 'JVN', 2, core.get_menu_id('FTT') +UNION ALL SELECT 'Template Transaction', '/Finance/TemplateTransaction.aspx', 'TTR', 2, core.get_menu_id('FTT') +UNION ALL SELECT 'Standing Instructions', '/Finance/StandingInstructions.aspx', 'STN', 2, core.get_menu_id('FTT') +UNION ALL SELECT 'Update Exchange Rates', '/Finance/UpdateExchangeRates.aspx', 'UER', 2, core.get_menu_id('FTT') +UNION ALL SELECT 'Reconcile Bank Account', '/Finance/BankReconcilation.aspx', 'RBA', 2, core.get_menu_id('FTT') +UNION ALL SELECT 'Voucher Verification', '/Finance/VoucherVerification.aspx', 'FVV', 2, core.get_menu_id('FTT') +UNION ALL SELECT 'Transaction Document Manager', '/Finance/TransactionDocumentManager.aspx', 'FTDM', 2, core.get_menu_id('FTT') +UNION ALL SELECT 'Setup & Maintenance', NULL, 'FSM', 1, core.get_menu_id('FI') +UNION ALL SELECT 'Chart of Accounts', '/Finance/Setup/COA.aspx', 'COA', 2, core.get_menu_id('FSM') +UNION ALL SELECT 'Currency Management', '/Finance/Setup/Currencies.aspx', 'CUR', 2, core.get_menu_id('FSM') +UNION ALL SELECT 'Bank Accounts', '/Finance/Setup/BankAccounts.aspx', 'CBA', 2, core.get_menu_id('FSM') +UNION ALL SELECT 'Product GL Mapping', '/Finance/Setup/ProductGLMapping.aspx', 'PGM', 2, core.get_menu_id('FSM') +UNION ALL SELECT 'Budgets & Targets', '/Finance/Setup/BudgetAndTarget.aspx', 'BT', 2, core.get_menu_id('FSM') +UNION ALL SELECT 'Ageing Slabs', '/Finance/Setup/AgeingSlabs.aspx', 'AGS', 2, core.get_menu_id('FSM') +UNION ALL SELECT 'Tax Types', '/Finance/Setup/TaxTypes.aspx', 'TTY', 2, core.get_menu_id('FSM') +UNION ALL SELECT 'Tax Setup', '/Finance/Setup/TaxSetup.aspx', 'TS', 2, core.get_menu_id('FSM') +UNION ALL SELECT 'Cost Centers', '/Finance/Setup/CostCenters.aspx', 'CC', 2, core.get_menu_id('FSM') +UNION ALL SELECT 'Manufacturing Workflow', NULL, 'MFW', 1, core.get_menu_id('MF') +UNION ALL SELECT 'Sales Forecast', '/Manufacturing/Workflow/SalesForecast.aspx', 'MFWSF', 2, core.get_menu_id('MFW') +UNION ALL SELECT 'Master Production Schedule', '/Manufacturing/Workflow/MasterProductionSchedule.aspx', 'MFWMPS', 2, core.get_menu_id('MFW') +UNION ALL SELECT 'Manufacturing Setup', NULL, 'MFS', 1, core.get_menu_id('MF') +UNION ALL SELECT 'Work Centers', '/Manufacturing/Setup/WorkCenters.aspx', 'MFSWC', 2, core.get_menu_id('MFS') +UNION ALL SELECT 'Bills of Material', '/Manufacturing/Setup/BillsOfMaterial.aspx', 'MFSBOM', 2, core.get_menu_id('MFS') +UNION ALL SELECT 'Manufacturing Reports', NULL, 'MFR', 1, core.get_menu_id('MF') +UNION ALL SELECT 'Gross & Net Requirements', '/Manufacturing/Reports/GrossAndNetRequirements.aspx', 'MFRGNR', 2, core.get_menu_id('MFR') +UNION ALL SELECT 'Capacity vs Lead', '/Manufacturing/Reports/CapacityVersusLead.aspx', 'MFRCVSL', 2, core.get_menu_id('MFR') +UNION ALL SELECT 'Shop Floor Planning', '/Manufacturing/Reports/ShopFloorPlanning.aspx', 'MFRSFP', 2, core.get_menu_id('MFR') +UNION ALL SELECT 'Production Order Status', '/Manufacturing/Reports/ProductionOrderStatus.aspx', 'MFRPOS', 2, core.get_menu_id('MFR') +UNION ALL SELECT 'CRM Main', NULL, 'CRMM', 1, core.get_menu_id('CRM') +UNION ALL SELECT 'Add a New Lead', '/CRM/Lead.aspx', 'CRML', 2, core.get_menu_id('CRMM') +UNION ALL SELECT 'Add a New Opportunity', '/CRM/Opportunity.aspx', 'CRMO', 2, core.get_menu_id('CRMM') +UNION ALL SELECT 'Convert Lead to Opportunity', '/CRM/ConvertLeadToOpportunity.aspx', 'CRMC', 2, core.get_menu_id('CRMM') +UNION ALL SELECT 'Lead Followup', '/CRM/LeadFollowup.aspx', 'CRMFL', 2, core.get_menu_id('CRMM') +UNION ALL SELECT 'Opportunity Followup', '/CRM/OpportunityFollowup.aspx', 'CRMFO', 2, core.get_menu_id('CRMM') +UNION ALL SELECT 'Setup & Maintenance', NULL, 'CSM', 1, core.get_menu_id('CRM') +UNION ALL SELECT 'Lead Sources Setup', '/CRM/Setup/LeadSources.aspx', 'CRMLS', 2, core.get_menu_id('CSM') +UNION ALL SELECT 'Lead Status Setup', '/CRM/Setup/LeadStatuses.aspx', 'CRMLST', 2, core.get_menu_id('CSM') +UNION ALL SELECT 'Opportunity Stages Setup', '/CRM/Setup/OpportunityStages.aspx', 'CRMOS', 2, core.get_menu_id('CSM') +UNION ALL SELECT 'Office Setup', NULL, 'SOS', 1, core.get_menu_id('SE') +UNION ALL SELECT 'Office & Branch Setup', '/Setup/Offices.aspx', 'SOB', 2, core.get_menu_id('SOS') +UNION ALL SELECT 'Department Setup', '/Setup/Departments.aspx', 'SDS', 2, core.get_menu_id('SOS') +UNION ALL SELECT 'Role Management', '/Setup/Roles.aspx', 'SRM', 2, core.get_menu_id('SOS') +UNION ALL SELECT 'User Management', '/Setup/Users.aspx', 'SUM', 2, core.get_menu_id('SOS') +UNION ALL SELECT 'Fiscal Year Information', '/Setup/FiscalYear.aspx', 'SFY', 2, core.get_menu_id('SOS') +UNION ALL SELECT 'Frequency & Fiscal Year Management', '/Setup/Frequency.aspx', 'SFR', 2, core.get_menu_id('SOS') +UNION ALL SELECT 'Policy Management', NULL, 'SPM', 1, core.get_menu_id('SE') +UNION ALL SELECT 'Voucher Verification Policy', '/Setup/Policy/VoucherVerification.aspx', 'SVV', 2, core.get_menu_id('SPM') +UNION ALL SELECT 'Automatic Verification Policy', '/Setup/Policy/AutoVerification.aspx', 'SAV', 2, core.get_menu_id('SPM') +UNION ALL SELECT 'Menu Access Policy', '/Setup/Policy/MenuAccess.aspx', 'SMA', 2, core.get_menu_id('SPM') +UNION ALL SELECT 'GL Access Policy', '/Setup/Policy/GLAccess.aspx', 'SAP', 2, core.get_menu_id('SPM') +UNION ALL SELECT 'Store Policy', '/Setup/Policy/Store.aspx', 'SSP', 2, core.get_menu_id('SPM') +UNION ALL SELECT 'Switches', '/Setup/Policy/Switches.aspx', 'SWI', 2, core.get_menu_id('SPM') +UNION ALL SELECT 'Admin Tools', NULL, 'SAT', 1, core.get_menu_id('SE') +UNION ALL SELECT 'SQL Query Tool', '/Setup/Admin/Query.aspx', 'SQL', 2, core.get_menu_id('SAT') +UNION ALL SELECT 'Database Statistics', '/Setup/Admin/DatabaseStatistics.aspx', 'DBSTAT', 2, core.get_menu_id('SAT') +UNION ALL SELECT 'Backup Database', '/Setup/Admin/Backup.aspx', 'BAK', 2, core.get_menu_id('SAT') +UNION ALL SELECT 'Restore Database', '/Setup/Admin/Restore.aspx', 'RES', 2, core.get_menu_id('SAT') +UNION ALL SELECT 'Change User Password', '/Setup/Admin/ChangePassword.aspx', 'PWD', 2, core.get_menu_id('SAT') +UNION ALL SELECT 'New Company', '/Setup/Admin/NewCompany.aspx', 'NEW', 2, core.get_menu_id('SAT'); + + + +CREATE VIEW office.login_view +AS +SELECT + users.user_id, + roles.role_code || ' (' || roles.role_name || ')' AS role, + roles.is_admin, + roles.is_system, + users.user_name, + users.full_name, + office.get_login_id(office.users.user_id) AS login_id, + office.get_logged_in_office_id(office.users.user_id) AS office_id, + logged_in_office.office_code || ' (' || logged_in_office.office_name || ')' AS office, + logged_in_office.office_code, + logged_in_office.office_name, + logged_in_office.nick_name, + logged_in_office.registration_date, + logged_in_office.registration_number, + logged_in_office.pan_number, + logged_in_office.address_line_1, + logged_in_office.address_line_2, + logged_in_office.street, + logged_in_office.city, + logged_in_office.state, + logged_in_office.country, + logged_in_office.zip_code, + logged_in_office.phone, + logged_in_office.fax, + logged_in_office.email, + logged_in_office.url +FROM + office.users +INNER JOIN + office.roles +ON + users.role_id = roles.role_id +INNER JOIN + office.offices +ON + users.office_id = offices.office_id +LEFT JOIN + office.offices AS logged_in_office +ON + logged_in_office.office_id = office.get_logged_in_office_id(office.users.user_id); + + +CREATE OR REPLACE VIEW office.role_view +AS +SELECT + roles.role_id, + roles.role_code, + roles.role_name +FROM + office.roles; + + +CREATE VIEW core.relationship_view +AS +SELECT + tc.table_schema, + tc.table_name, + kcu.column_name, + ccu.table_schema AS references_schema, + ccu.table_name AS references_table, + ccu.column_name AS references_field +FROM + information_schema.table_constraints tc +LEFT JOIN + information_schema.key_column_usage kcu + ON tc.constraint_catalog = kcu.constraint_catalog + AND tc.constraint_schema = kcu.constraint_schema + AND tc.constraint_name = kcu.constraint_name +LEFT JOIN + information_schema.referential_constraints rc + ON tc.constraint_catalog = rc.constraint_catalog + AND tc.constraint_schema = rc.constraint_schema + AND tc.constraint_name = rc.constraint_name +LEFT JOIN + information_schema.constraint_column_usage ccu + ON rc.unique_constraint_catalog = ccu.constraint_catalog + AND rc.unique_constraint_schema = ccu.constraint_schema + AND rc.unique_constraint_name = ccu.constraint_name +WHERE + lower(tc.constraint_type) in ('foreign key'); + + +CREATE FUNCTION core.parse_default(text) +RETURNS text +AS +$$ +DECLARE _sql text; +DECLARE _val text; +BEGIN + IF($1 LIKE '%::%' AND $1 NOT LIKE 'nextval%') THEN + _sql := 'SELECT ' || $1; + EXECUTE _sql INTO _val; + RETURN _val; + END IF; + + RETURN $1; +END +$$ +LANGUAGE plpgsql; + +CREATE VIEW core.mixerp_table_view +AS +SELECT information_schema.columns.table_schema, + information_schema.columns.table_name, + information_schema.columns.column_name, + references_schema, + references_table, + references_field, + ordinal_position, + is_nullable, + core.parse_default(column_default) AS column_default, + data_type, + domain_name, + character_maximum_length, + character_octet_length, + numeric_precision, + numeric_precision_radix, + numeric_scale, + datetime_precision, + udt_name +FROM information_schema.columns + LEFT JOIN core.relationship_view + ON information_schema.columns.table_schema = + core.relationship_view.table_schema + AND information_schema.columns.table_name = + core.relationship_view.table_name + AND information_schema.columns.column_name = + core.relationship_view.column_name +WHERE information_schema.columns.table_schema +NOT IN + ( + 'pg_catalog', 'information_schema' + ) +AND information_schema.columns.column_name +NOT IN + ( + 'audit_user_id', 'audit_ts' + ) +; + + +CREATE TABLE core.frequencies +( + frequency_id SERIAL NOT NULL PRIMARY KEY, + frequency_code national character varying(12) NOT NULL, + frequency_name national character varying(50) NOT NULL +); + + +CREATE UNIQUE INDEX frequencies_frequency_code_uix +ON core.frequencies(UPPER(frequency_code)); + +CREATE UNIQUE INDEX frequencies_frequency_name_uix +ON core.frequencies(UPPER(frequency_name)); + +INSERT INTO core.frequencies +SELECT 2, 'EOM', 'End of Month' UNION ALL +SELECT 3, 'EOQ', 'End of Quarter' UNION ALL +SELECT 4, 'EOH', 'End of Half' UNION ALL +SELECT 5, 'EOY', 'End of Year'; + + +CREATE TABLE core.fiscal_year +( + fiscal_year_code national character varying(12) NOT NULL PRIMARY KEY, + fiscal_year_name national character varying(50) NOT NULL, + starts_from date NOT NULL, + ends_on date NOT NULL, + audit_user_id integer NULL REFERENCES office.users(user_id), + audit_ts TIMESTAMP WITH TIME ZONE NULL DEFAULT(NOW()) +); + +CREATE UNIQUE INDEX fiscal_year_fiscal_year_name_uix +ON core.fiscal_year(UPPER(fiscal_year_name)); + +CREATE UNIQUE INDEX fiscal_year_starts_from_uix +ON core.fiscal_year(starts_from); + +CREATE UNIQUE INDEX fiscal_year_ends_on_uix +ON core.fiscal_year(ends_on); + + +CREATE TABLE core.frequency_setups +( + frequency_setup_id SERIAL NOT NULL PRIMARY KEY, + fiscal_year_code national character varying(12) NOT NULL REFERENCES core.fiscal_year(fiscal_year_code), + value_date date NOT NULL UNIQUE, + frequency_id integer NOT NULL REFERENCES core.frequencies(frequency_id), + audit_user_id integer NULL REFERENCES office.users(user_id), + audit_ts TIMESTAMP WITH TIME ZONE NULL DEFAULT(NOW()) +); + +--TODO: Validation constraints for core.frequency_setups + +CREATE TABLE core.units +( + unit_id SERIAL NOT NULL PRIMARY KEY, + unit_code national character varying(12) NOT NULL, + unit_name national character varying(50) NOT NULL, + audit_user_id integer NULL REFERENCES office.users(user_id), + audit_ts TIMESTAMP WITH TIME ZONE NULL DEFAULT(NOW()) +); + +CREATE UNIQUE INDEX units_unit_code_uix +ON core.units(UPPER(unit_code)); + +CREATE UNIQUE INDEX "units_unit_name_uix" +ON core.units(UPPER(unit_name)); + +INSERT INTO core.units(unit_code, unit_name) +SELECT 'PC', 'Piece' UNION ALL +SELECT 'FT', 'Feet' UNION ALL +SELECT 'MTR', 'Meter' UNION ALL +SELECT 'LTR', 'Liter' UNION ALL +SELECT 'GM', 'Gram' UNION ALL +SELECT 'KG', 'Kilogram' UNION ALL +SELECT 'DZ', 'Dozen' UNION ALL +SELECT 'BX', 'Box'; + +CREATE FUNCTION core.get_unit_id_by_unit_code(text) +RETURNS smallint +AS +$$ +BEGIN + RETURN + ( + SELECT + core.units.unit_id + FROM + core.units + WHERE + core.units.unit_code=$1 + ); +END +$$ +LANGUAGE plpgsql; + +CREATE FUNCTION core.get_unit_id_by_unit_name(text) +RETURNS integer +AS +$$ +BEGIN + RETURN + ( + SELECT + core.units.unit_id + FROM + core.units + WHERE + core.units.unit_name=$1 + ); +END +$$ +LANGUAGE plpgsql; + +CREATE TABLE core.compound_units +( + compound_unit_id SERIAL NOT NULL PRIMARY KEY, + base_unit_id integer NOT NULL REFERENCES core.units(unit_id), + value smallint NOT NULL, + compare_unit_id integer NOT NULL REFERENCES core.units(unit_id), + audit_user_id integer NULL REFERENCES office.users(user_id), + audit_ts TIMESTAMP WITH TIME ZONE NULL DEFAULT(NOW()), + CONSTRAINT compound_units_check CHECK(base_unit_id != compare_unit_id) +); + +CREATE UNIQUE INDEX compound_units_info_uix +ON core.compound_units(base_unit_id, compare_unit_id); + +INSERT INTO core.compound_units(base_unit_id, compare_unit_id, value) +SELECT core.get_unit_id_by_unit_code('PC'), core.get_unit_id_by_unit_code('DZ'), 12 UNION ALL +SELECT core.get_unit_id_by_unit_code('DZ'), core.get_unit_id_by_unit_code('BX'), 100 UNION ALL +SELECT core.get_unit_id_by_unit_code('GM'), core.get_unit_id_by_unit_code('KG'), 1000; + +CREATE FUNCTION core.get_root_unit_id(integer) +RETURNS integer +AS +$$ + DECLARE root_unit_id integer; +BEGIN + SELECT base_unit_id INTO root_unit_id + FROM core.compound_units + WHERE compare_unit_id=$1; + + IF(root_unit_id IS NULL) THEN + RETURN $1; + ELSE + RETURN core.get_root_unit_id(root_unit_id); + END IF; +END +$$ +LANGUAGE plpgsql; + +CREATE FUNCTION core.is_parent_unit(parent integer, child integer) +RETURNS boolean +AS +$$ +BEGIN + IF $1!=$2 THEN + IF EXISTS + ( + WITH RECURSIVE unit_cte(unit_id) AS + ( + SELECT tn.compare_unit_id + FROM core.compound_units AS tn WHERE tn.base_unit_id = $1 + UNION ALL + SELECT + c.compare_unit_id + FROM unit_cte AS p, + core.compound_units AS c + WHERE base_unit_id = p.unit_id + ) + + SELECT * FROM unit_cte + WHERE unit_id=$2 + ) THEN + RETURN TRUE; + END IF; + END IF; + RETURN false; +END +$$ +LANGUAGE plpgsql; + +CREATE FUNCTION core.convert_unit(integer, integer) +RETURNS decimal +AS +$$ + DECLARE _factor decimal; +BEGIN + IF(core.get_root_unit_id($1) != core.get_root_unit_id($2)) THEN + RETURN 0; + END IF; + + IF($1 = $2) THEN + RETURN 1.00; + END IF; + + IF(core.is_parent_unit($1, $2)) THEN + WITH RECURSIVE unit_cte(unit_id, value) AS + ( + SELECT tn.compare_unit_id, tn.value + FROM core.compound_units AS tn WHERE tn.base_unit_id = $1 + + UNION ALL + + SELECT + c.compare_unit_id, c.value * p.value + FROM unit_cte AS p, + core.compound_units AS c + WHERE base_unit_id = p.unit_id + ) + SELECT 1.00/value INTO _factor + FROM unit_cte + WHERE unit_id=$2; + ELSE + WITH RECURSIVE unit_cte(unit_id, value) AS + ( + SELECT tn.compare_unit_id, tn.value + FROM core.compound_units AS tn WHERE tn.base_unit_id = $2 + UNION ALL + SELECT + c.compare_unit_id, c.value * p.value + FROM unit_cte AS p, + core.compound_units AS c + WHERE base_unit_id = p.unit_id + ) + + SELECT value INTO _factor + FROM unit_cte + WHERE unit_id=$1; + END IF; + + RETURN _factor; +END +$$ +LANGUAGE plpgsql; + + +CREATE FUNCTION core.get_associated_units(integer) +RETURNS TABLE(unit_id integer, unit_code text, unit_name text) +AS +$$ + DECLARE root_unit_id integer; +BEGIN + CREATE TEMPORARY TABLE IF NOT EXISTS temp_unit(unit_id integer) ON COMMIT DROP; + + SELECT core.get_root_unit_id($1) INTO root_unit_id; + + INSERT INTO temp_unit(unit_id) + SELECT root_unit_id + WHERE NOT EXISTS + ( + SELECT * FROM temp_unit + WHERE temp_unit.unit_id=root_unit_id + ); + + WITH RECURSIVE cte(unit_id) + AS + ( + SELECT + compare_unit_id + FROM + core.compound_units + WHERE + base_unit_id = root_unit_id + + UNION ALL + + SELECT + units.compare_unit_id + FROM + core.compound_units units + INNER JOIN cte + ON cte.unit_id = units.base_unit_id + ) + + INSERT INTO temp_unit(unit_id) + SELECT cte.unit_id FROM cte; + + DELETE FROM temp_unit + WHERE temp_unit.unit_id IS NULL; + + RETURN QUERY + SELECT + core.units.unit_id, + core.units.unit_code::text, + core.units.unit_name::text + FROM + core.units + WHERE + core.units.unit_id + IN + ( + SELECT temp_unit.unit_id FROM temp_unit + ); +END +$$ +LANGUAGE plpgsql; + + +CREATE FUNCTION core.get_associated_units_from_item_id(integer) +RETURNS TABLE(unit_id integer, unit_code text, unit_name text) +AS +$$ +DECLARE _unit_id integer; +BEGIN + SELECT core.items.unit_id INTO _unit_id + FROM core.items + WHERE core.items.item_id=$1; + + RETURN QUERY + SELECT ret.unit_id, ret.unit_code, ret.unit_name + FROM core.get_associated_units(_unit_id) AS ret; + +END +$$ +LANGUAGE plpgsql; + +CREATE FUNCTION core.get_associated_units_from_item_code(text) +RETURNS TABLE(unit_id integer, unit_code text, unit_name text) +AS +$$ +DECLARE _unit_id integer; +BEGIN + SELECT core.items.unit_id INTO _unit_id + FROM core.items + WHERE core.items.item_code=$1; + + RETURN QUERY + SELECT ret.unit_id, ret.unit_code, ret.unit_name + FROM core.get_associated_units(_unit_id) AS ret; + +END +$$ +LANGUAGE plpgsql; + + +CREATE VIEW core.compound_unit_view +AS +SELECT + compound_unit_id, + base_unit.unit_name base_unit_name, + value, + compare_unit.unit_name compare_unit_name +FROM + core.compound_units, + core.units base_unit, + core.units compare_unit +WHERE + core.compound_units.base_unit_id = base_unit.unit_id +AND + core.compound_units.compare_unit_id = compare_unit.unit_id; + + +--TODO +CREATE VIEW core.unit_view +AS +SELECT * FROM core.units; + +CREATE FUNCTION core.get_base_quantity_by_unit_name(text, integer) +RETURNS decimal +AS +$$ +DECLARE _unit_id integer; +DECLARE _root_unit_id integer; +DECLARE _factor decimal; +BEGIN + _unit_id := core.get_unit_id_by_unit_name($1); + _root_unit_id = core.get_root_unit_id(_unit_id); + _factor = core.convert_unit(_unit_id, _root_unit_id); + + RETURN _factor * $2; +END +$$ +LANGUAGE plpgsql; + +CREATE FUNCTION core.get_base_unit_id_by_unit_name(text) +RETURNS integer +AS +$$ +DECLARE _unit_id integer; +BEGIN + _unit_id := core.get_unit_id_by_unit_name($1); + + RETURN + ( + core.get_root_unit_id(_unit_id) + ); +END +$$ +LANGUAGE plpgsql; + +CREATE TABLE core.account_masters +( + account_master_id SERIAL NOT NULL PRIMARY KEY, + account_master_code national character varying(3) NOT NULL, + account_master_name national character varying(40) NOT NULL +); + +CREATE UNIQUE INDEX account_master_code_uix +ON core.account_masters(UPPER(account_master_code)); + +CREATE UNIQUE INDEX account_master_name_uix +ON core.account_masters(UPPER(account_master_name)); + + + +CREATE TABLE core.accounts +( + account_id SERIAL NOT NULL PRIMARY KEY, + account_master_id integer NOT NULL REFERENCES core.account_masters(account_master_id), + account_code national character varying(12) NOT NULL, + external_code national character varying(12) NULL CONSTRAINT accounts_external_code_df DEFAULT(''), + confidential boolean NOT NULL CONSTRAINT accounts_confidential_df DEFAULT(false), + account_name national character varying(100) NOT NULL, + description national character varying(200) NULL, + sys_type boolean NOT NULL CONSTRAINT accounts_sys_type_df DEFAULT(false), + is_cash boolean NOT NULL CONSTRAINT accounts_is_cash_df DEFAULT(false), + parent_account_id integer NULL REFERENCES core.accounts(account_id), + audit_user_id integer NULL REFERENCES office.users(user_id), + audit_ts TIMESTAMP WITH TIME ZONE NULL DEFAULT(NOW()) +); + + +CREATE UNIQUE INDEX accountsCode_uix +ON core.accounts(UPPER(account_code)); + +CREATE UNIQUE INDEX accounts_Name_uix +ON core.accounts(UPPER(account_name)); + +CREATE FUNCTION core.has_child_accounts(integer) +RETURNS boolean +AS +$$ +BEGIN + IF EXISTS(SELECT 0 FROM core.accounts WHERE parent_account_id=$1 LIMIT 1) THEN + RETURN true; + END IF; + + RETURN false; +END +$$ +LANGUAGE plpgsql; + + +CREATE FUNCTION core.get_cash_account_id() +RETURNS integer +AS +$$ +BEGIN + RETURN + ( + SELECT account_id + FROM core.accounts + WHERE is_cash=true + LIMIT 1 + ); +END +$$ +LANGUAGE plpgsql; + +CREATE VIEW core.account_view +AS +SELECT + core.accounts.account_id, + core.account_masters.account_master_code, + core.accounts.account_code, + core.accounts.external_code, + core.accounts.account_name, + core.accounts.confidential, + core.accounts.description, + core.accounts.sys_type, + core.accounts.is_cash, + parent_account.account_code || ' (' || parent_account.account_name || ')' AS parent, + core.has_child_accounts(core.accounts.account_id) AS has_child +FROM core.accounts +INNER JOIN core.account_masters +ON core.account_masters.account_master_id=core.accounts.account_master_id +LEFT JOIN core.accounts parent_account +ON parent_account.account_id=core.accounts.parent_account_id; + +INSERT INTO core.account_masters(account_master_code, account_master_name) SELECT 'BSA', 'Balance Sheet A/C'; +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '10000', 'Assets', TRUE, (SELECT account_id FROM core.accounts WHERE account_name='Balance Sheet A/C'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '10001', 'Current Assets', TRUE, (SELECT account_id FROM core.accounts WHERE account_name='Assets'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '10100', 'Cash at Bank A/C', TRUE, (SELECT account_id FROM core.accounts WHERE account_name='Current Assets'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '10110', 'Regular Checking Account', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Cash at Bank A/C'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '10120', 'Payroll Checking Account', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Cash at Bank A/C'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '10130', 'Savings Account', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Cash at Bank A/C'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '10140', 'Special Account', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Cash at Bank A/C'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id, is_cash) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '10200', 'Cash in Hand A/C', TRUE, (SELECT account_id FROM core.accounts WHERE account_name='Current Assets'), true; +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '10300', 'Investments', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Current Assets'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '10310', 'Short Term Investment', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Investments'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '10320', 'Other Investments', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Investments'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '10321', 'Investments-Money Market', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Other Investments'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '10322', 'Bank Deposit Contract (Fixed Deposit)', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Other Investments'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '10323', 'Investments-Certificates of Deposit', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Other Investments'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '10400', 'Accounts Receivable', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Current Assets'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '10500', 'Other Receivables', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Current Assets'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '10600', 'Allowance for Doubtful Accounts', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Current Assets'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '10700', 'Inventory', TRUE, (SELECT account_id FROM core.accounts WHERE account_name='Current Assets'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '10720', 'Raw Materials Inventory', TRUE, (SELECT account_id FROM core.accounts WHERE account_name='Inventory'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '10730', 'Supplies Inventory', TRUE, (SELECT account_id FROM core.accounts WHERE account_name='Inventory'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '10740', 'Work in Progress Inventory', TRUE, (SELECT account_id FROM core.accounts WHERE account_name='Inventory'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '10750', 'Finished Goods Inventory', TRUE, (SELECT account_id FROM core.accounts WHERE account_name='Inventory'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '10800', 'Prepaid Expenses', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Current Assets'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '10900', 'Employee Advances', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Current Assets'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '11000', 'Notes Receivable-Current', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Current Assets'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '11100', 'Prepaid Interest', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Current Assets'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '11200', 'Accrued Incomes (Assets)', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Current Assets'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '11300', 'Other Debtors', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Current Assets'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '11400', 'Other Current Assets', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Current Assets'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '12001', 'Noncurrent Assets', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Assets'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '12100', 'Furniture and Fixtures', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Noncurrent Assets'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '12200', 'Plants & Equipments', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Noncurrent Assets'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '12300', 'Rental Property', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Noncurrent Assets'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '12400', 'Vehicles', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Noncurrent Assets'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '12500', 'Intangibles', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Noncurrent Assets'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '12600', 'Other Depreciable Properties', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Noncurrent Assets'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '12700', 'Leasehold Improvements', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Noncurrent Assets'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '12800', 'Buildings', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Noncurrent Assets'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '12900', 'Building Improvements', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Noncurrent Assets'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '13000', 'Interior Decorations', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Noncurrent Assets'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '13100', 'Land', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Noncurrent Assets'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '13200', 'Long Term Investments', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Noncurrent Assets'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '13300', 'Trade Debtors', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Noncurrent Assets'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '13400', 'Rental Debtors', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Noncurrent Assets'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '13500', 'Staff Debtors', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Noncurrent Assets'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '13600', 'Other Noncurrent Debtors', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Noncurrent Assets'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '13700', 'Other Financial Assets', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Noncurrent Assets'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '13710', 'Deposits Held', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Other Financial Assets'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '13800', 'Accumulated Depreciations', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Noncurrent Assets'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '13810', 'Accumulated Depreciation-Furniture and Fixtures', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Accumulated Depreciations'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '13820', 'Accumulated Depreciation-Equipment', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Accumulated Depreciations'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '13830', 'Accumulated Depreciation-Vehicles', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Accumulated Depreciations'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '13840', 'Accumulated Depreciation-Other Depreciable Properties', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Accumulated Depreciations'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '13850', 'Accumulated Depreciation-Leasehold', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Accumulated Depreciations'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '13860', 'Accumulated Depreciation-Buildings', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Accumulated Depreciations'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '13870', 'Accumulated Depreciation-Building Improvements', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Accumulated Depreciations'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '13880', 'Accumulated Depreciation-Interior Decorations', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Accumulated Depreciations'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '14001', 'Other Assets', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Assets'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '14100', 'Other Assets-Deposits', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Other Assets'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '14200', 'Other Assets-Organization Costs', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Other Assets'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '14300', 'Other Assets-Accumulated Amortization-Organization Costs', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Other Assets'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '14400', 'Notes Receivable-Non-current', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Other Assets'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '14500', 'Other Non-current Assets', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Other Assets'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '14600', 'Nonfinancial Assets', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Other Assets'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '20000', 'Liabilities', TRUE, (SELECT account_id FROM core.accounts WHERE account_name='Balance Sheet A/C'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '20001', 'Current Liabilities', TRUE, (SELECT account_id FROM core.accounts WHERE account_name='Liabilities'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '20100', 'Accounts Payable', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Current Liabilities'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '20110', 'Shipping Charge Payable', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Current Liabilities'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '20200', 'Accrued Expenses', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Current Liabilities'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '20300', 'Wages Payable', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Current Liabilities'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '20400', 'Deductions Payable', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Current Liabilities'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '20500', 'Health Insurance Payable', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Current Liabilities'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '20600', 'Superannutation Payable', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Current Liabilities'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '20700', 'Tax Payables', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Current Liabilities'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '20710', 'Sales Tax Payable', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Tax Payables'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '20720', 'Federal Payroll Taxes Payable', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Tax Payables'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '20730', 'FUTA Tax Payable', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Tax Payables'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '20740', 'State Payroll Taxes Payable', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Tax Payables'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '20750', 'SUTA Payable', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Tax Payables'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '20760', 'Local Payroll Taxes Payable', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Tax Payables'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '20770', 'Income Taxes Payable', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Tax Payables'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '20780', 'Other Taxes Payable', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Tax Payables'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '20800', 'Employee Benefits Payable', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Current Liabilities'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '20810', 'Provision for Annual Leave', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Employee Benefits Payable'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '20820', 'Provision for Long Service Leave', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Employee Benefits Payable'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '20830', 'Provision for Personal Leave', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Employee Benefits Payable'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '20840', 'Provision for Health Leave', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Employee Benefits Payable'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '20900', 'Current Portion of Long-term Debt', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Current Liabilities'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '21000', 'Advance Incomes', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Current Liabilities'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '21010', 'Advance Sales Income', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Advance Incomes'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '21020', 'Grant Received in Advance', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Advance Incomes'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '21100', 'Deposits from Customers', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Current Liabilities'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '21200', 'Other Current Liabilities', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Current Liabilities'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '21210', 'Short Term Loan Payables', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Other Current Liabilities'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '21220', 'Short Term Hirepurchase Payables', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Other Current Liabilities'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '21230', 'Short Term Lease Liability', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Other Current Liabilities'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '21240', 'Grants Repayable', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Other Current Liabilities'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '24001', 'Noncurrent Liabilities', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Liabilities'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '24100', 'Notes Payable', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Noncurrent Liabilities'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '24200', 'Land Payable', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Noncurrent Liabilities'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '24300', 'Equipment Payable', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Noncurrent Liabilities'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '24400', 'Vehicles Payable', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Noncurrent Liabilities'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '24500', 'Lease Liability', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Noncurrent Liabilities'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '24600', 'Loan Payable', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Noncurrent Liabilities'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '24700', 'Hirepurchase Payable', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Noncurrent Liabilities'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '24800', 'Bank Loans Payable', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Noncurrent Liabilities'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '24900', 'Deferred Revenue', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Noncurrent Liabilities'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '25000', 'Other Long-term Liabilities', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Noncurrent Liabilities'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '25010', 'Long Term Employee Benefit Provision', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Other Long-term Liabilities'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '28001', 'Equity', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Liabilities'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '28100', 'Stated Capital', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Equity'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '28110', 'Founder Capital', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Stated Capital'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '28120', 'Promoter Capital', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Stated Capital'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '28130', 'Member Capital', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Stated Capital'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '28200', 'Capital Surplus', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Equity'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '28210', 'Share Premium', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Capital Surplus'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '28220', 'Capital Redemption Reserves', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Capital Surplus'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '28230', 'Statutory Reserves', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Capital Surplus'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '28240', 'Asset Revaluation Reserves', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Capital Surplus'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '28250', 'Exchange Rate Fluctuation Reserves', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Capital Surplus'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '28260', 'Capital Reserves Arising From Merger', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Capital Surplus'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '28270', 'Capital Reserves Arising From Acuisition', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Capital Surplus'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '28300', 'Retained Surplus', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Equity'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '28310', 'Accumulated Profits', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Retained Surplus'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '28320', 'Accumulated Losses', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Retained Surplus'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '28400', 'Treasury Stock', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Equity'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '28500', 'Current Year Surplus', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Equity'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '28600', 'General Reserves', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Equity'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '28700', 'Other Reserves', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Equity'); +INSERT INTO core.account_masters(account_master_code, account_master_name) SELECT 'PLA', 'Profit and Loss A/C'; +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '30000', 'Revenues', TRUE, (SELECT account_id FROM core.accounts WHERE account_name='Profit and Loss A/C'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '30100', 'Sales A/C', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Revenues'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '30200', 'Interest Income', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Revenues'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '30300', 'Other Income', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Revenues'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '30400', 'Finance Charge Income', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Revenues'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '30500', 'Shipping Charges Reimbursed', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Revenues'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '30600', 'Sales Returns and Allowances', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Revenues'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '30700', 'Sales Discounts', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Revenues'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '40000', 'Expenses', TRUE, (SELECT account_id FROM core.accounts WHERE account_name='Profit and Loss A/C'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '40100', 'Purchase A/C', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Expenses'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '40200', 'Cost of GoodS Sold', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Expenses'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '40205', 'Product Cost', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Cost of GoodS Sold'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '40210', 'Raw Material Purchases', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Cost of GoodS Sold'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '40215', 'Direct Labor Costs', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Cost of GoodS Sold'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '40220', 'Indirect Labor Costs', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Cost of GoodS Sold'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '40225', 'Heat and Power', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Cost of GoodS Sold'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '40230', 'Commissions', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Cost of GoodS Sold'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '40235', 'Miscellaneous Factory Costs', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Cost of GoodS Sold'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '40240', 'Cost of Goods Sold-Salaries and Wages', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Cost of GoodS Sold'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '40245', 'Cost of Goods Sold-Contract Labor', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Cost of GoodS Sold'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '40250', 'Cost of Goods Sold-Freight', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Cost of GoodS Sold'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '40255', 'Cost of Goods Sold-Other', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Cost of GoodS Sold'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '40260', 'Inventory Adjustments', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Cost of GoodS Sold'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '40265', 'Purchase Returns and Allowances', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Cost of GoodS Sold'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '40270', 'Purchase Discounts', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Cost of GoodS Sold'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '40300', 'General Purchase Expenses', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Expenses'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '40400', 'Advertising Expenses', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Expenses'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '40500', 'Amortization Expenses', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Expenses'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '40600', 'Auto Expenses', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Expenses'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '40700', 'Bad Debt Expenses', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Expenses'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '40800', 'Bank Fees', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Expenses'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '40900', 'Cash Over and Short', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Expenses'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '41000', 'Charitable Contributions Expenses', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Expenses'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '41100', 'Commissions and Fees Expenses', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Expenses'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '41200', 'Depreciation Expenses', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Expenses'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '41300', 'Dues and Subscriptions Expenses', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Expenses'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '41400', 'Employee Benefit Expenses', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Expenses'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '41410', 'Employee Benefit Expenses-Health Insurance', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Employee Benefit Expenses'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '41420', 'Employee Benefit Expenses-Pension Plans', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Employee Benefit Expenses'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '41430', 'Employee Benefit Expenses-Profit Sharing Plan', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Employee Benefit Expenses'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '41440', 'Employee Benefit Expenses-Other', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Employee Benefit Expenses'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '41500', 'Freight Expenses', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Expenses'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '41600', 'Gifts Expenses', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Expenses'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '41700', 'Income Tax Expenses', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Expenses'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '41710', 'Income Tax Expenses-Federal', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Income Tax Expenses'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '41720', 'Income Tax Expenses-State', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Income Tax Expenses'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '41730', 'Income Tax Expenses-Local', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Income Tax Expenses'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '41800', 'Insurance Expenses', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Expenses'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '41810', 'Insurance Expenses-Product Liability', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Insurance Expenses'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '41820', 'Insurance Expenses-Vehicle', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Insurance Expenses'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '41900', 'Interest Expenses', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Expenses'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '42000', 'Laundry and Dry Cleaning Expenses', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Expenses'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '42100', 'Legal and Professional Expenses', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Expenses'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '42200', 'Licenses Expenses', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Expenses'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '42300', 'Loss on NSF Checks', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Expenses'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '42400', 'Maintenance Expenses', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Expenses'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '42500', 'Meals and Entertainment Expenses', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Expenses'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '42600', 'Office Expenses', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Expenses'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '42700', 'Payroll Tax Expenses', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Expenses'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '42800', 'Penalties and Fines Expenses', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Expenses'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '42900', 'Other Taxe Expenses', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Expenses'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '43000', 'Postage Expenses', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Expenses'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '43100', 'Rent or Lease Expenses', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Expenses'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '43200', 'Repair and Maintenance Expenses', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Expenses'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '43210', 'Repair and Maintenance Expenses-Office', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Repair and Maintenance Expenses'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '43220', 'Repair and Maintenance Expenses-Vehicle', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Repair and Maintenance Expenses'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '43300', 'Supplies Expenses-Office', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Expenses'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '43400', 'Telephone Expenses', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Expenses'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '43500', 'Training Expenses', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Expenses'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '43600', 'Travel Expenses', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Expenses'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '43700', 'Salary Expenses', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Expenses'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '43800', 'Wages Expenses', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Expenses'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '43900', 'Utilities Expenses', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Expenses'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '44000', 'Other Expenses', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Expenses'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '44100', 'Gain/Loss on Sale of Assets', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Expenses'); +INSERT INTO core.account_masters(account_master_code, account_master_name) SELECT 'OBS', 'Off Balance Sheet A/C'; + +CREATE FUNCTION core.disable_editing_sys_type() +RETURNS TRIGGER +AS +$$ +BEGIN + IF TG_OP='UPDATE' OR TG_OP='DELETE' THEN + IF EXISTS + ( + SELECT * + FROM core.accounts + WHERE (sys_type=true OR is_cash=true) + AND account_id=OLD.account_id + ) THEN + RAISE EXCEPTION 'You are not allowed to change system accounts.'; + END IF; + RETURN OLD; + END IF; + + IF TG_OP='INSERT' THEN + IF (NEW.sys_type=true OR NEW.is_cash=true) THEN + RAISE EXCEPTION 'You are not allowed to add system accounts.'; + END IF; + RETURN NEW; + END IF; + +END +$$ +LANGUAGE plpgsql; + +CREATE TRIGGER restrict_delete_sys_type_trigger +BEFORE DELETE +ON core.accounts +FOR EACH ROW EXECUTE PROCEDURE core.disable_editing_sys_type(); + +CREATE TRIGGER restrict_update_sys_type_trigger +BEFORE UPDATE +ON core.accounts +FOR EACH ROW EXECUTE PROCEDURE core.disable_editing_sys_type(); + +CREATE TRIGGER restrict_insert_sys_type_trigger +BEFORE INSERT +ON core.accounts +FOR EACH ROW EXECUTE PROCEDURE core.disable_editing_sys_type(); + +CREATE VIEW core.accounts_view +AS +SELECT + core.accounts.account_id, + core.accounts.account_code, + core.accounts.account_name, + core.accounts.description, + core.accounts.sys_type, + core.accounts.parent_account_id, + parent_accounts.account_code AS parent_account_code, + parent_accounts.account_name AS parent_account_name, + core.account_masters.account_master_id, + core.account_masters.account_master_code, + core.account_masters.account_master_name +FROM + core.account_masters + INNER JOIN core.accounts + ON core.account_masters.account_master_id = core.accounts.account_master_id + LEFT OUTER JOIN core.accounts AS parent_accounts + ON core.accounts.parent_account_id = parent_accounts.account_id; + + +CREATE FUNCTION core.get_account_id_by_account_code(text) +RETURNS integer +AS +$$ +BEGIN + RETURN + ( + SELECT account_id + FROM core.accounts + WHERE account_code=$1 + ); +END +$$ +LANGUAGE plpgsql; + + +CREATE TABLE core.account_parameters +( + account_parameter_id SERIAL NOT NULL CONSTRAINT account_parameters_pk PRIMARY KEY, + parameter_name national character varying(128) NOT NULL, + account_id integer NOT NULL REFERENCES core.accounts(account_id), + audit_user_id integer NULL REFERENCES office.users(user_id), + audit_ts TIMESTAMP WITH TIME ZONE NULL DEFAULT(NOW()) +); + +CREATE UNIQUE INDEX account_parameters_parameter_name_uix +ON core.account_parameters(UPPER(parameter_name)); + +INSERT INTO core.account_parameters(parameter_name, account_id) +SELECT 'Sales', core.get_account_id_by_account_code('30100') UNION ALL +SELECT 'Sales.Receivables', core.get_account_id_by_account_code('10400') UNION ALL +SELECT 'Sales.Discount', core.get_account_id_by_account_code('30700') UNION ALL +SELECT 'Sales.Tax', core.get_account_id_by_account_code('20700') UNION ALL +SELECT 'Purchase', core.get_account_id_by_account_code('40100') UNION ALL +SELECT 'Purchase.Payables', core.get_account_id_by_account_code('20100') UNION ALL +SELECT 'Purchase.Discount', core.get_account_id_by_account_code('40270') UNION ALL +SELECT 'Purchase.Tax', core.get_account_id_by_account_code('20700') UNION ALL +SELECT 'Inventory', core.get_account_id_by_account_code('10700') UNION ALL +SELECT 'COGS', core.get_account_id_by_account_code('40200'); + +CREATE FUNCTION core.get_account_id_by_parameter(text) +RETURNS integer +AS +$$ +BEGIN + RETURN + ( + SELECT + account_id + FROM + core.account_parameters + WHERE + parameter_name=$1 + ); +END +$$ +LANGUAGE plpgsql; + +CREATE FUNCTION core.get_account_name(integer) +RETURNS text +AS +$$ +BEGIN + RETURN + ( + SELECT + account_name + FROM + core.accounts + WHERE + account_id=$1 + ); +END +$$ +LANGUAGE plpgsql; + +CREATE TABLE core.bank_accounts +( + account_id integer NOT NULL CONSTRAINT bank_accounts_pk PRIMARY KEY + CONSTRAINT bank_accounts_accounts_fk REFERENCES core.accounts(account_id), + maintained_by_user_id integer NOT NULL CONSTRAINT bank_accounts_users_fk REFERENCES office.users(user_id), + bank_name national character varying(128) NOT NULL, + bank_branch national character varying(128) NOT NULL, + bank_contact_number national character varying(128) NULL, + bank_address text NULL, + bank_account_code national character varying(128) NULL, + bank_account_type national character varying(128) NULL, + relationship_officer_name national character varying(128) NULL, + audit_user_id integer NULL REFERENCES office.users(user_id), + audit_ts TIMESTAMP WITH TIME ZONE NULL DEFAULT(NOW()) +); + + +CREATE VIEW core.bank_account_view +AS +SELECT + core.accounts.account_id, + core.accounts.account_code, + core.accounts.account_name, + office.users.user_name AS maintained_by, + core.bank_accounts.bank_name, + core.bank_accounts.bank_branch, + core.bank_accounts.bank_contact_number, + core.bank_accounts.bank_address, + core.bank_accounts.bank_account_code, + core.bank_accounts.bank_account_type, + core.bank_accounts.relationship_officer_name AS relation_officer +FROM + core.bank_accounts +INNER JOIN core.accounts ON core.accounts.account_id = core.bank_accounts.account_id +INNER JOIN office.users ON core.bank_accounts.maintained_by_user_id = office.users.user_id; + +CREATE TABLE core.agents +( + agent_id SERIAL NOT NULL PRIMARY KEY, + agent_code national character varying(12) NOT NULL, + agent_name national character varying(100) NOT NULL, + address national character varying(100) NOT NULL, + contact_number national character varying(50) NOT NULL, + commission_rate decimal_strict2 NOT NULL DEFAULT(0), + account_id integer NOT NULL REFERENCES core.accounts(account_id), + audit_user_id integer NULL REFERENCES office.users(user_id), + audit_ts TIMESTAMP WITH TIME ZONE NULL DEFAULT(NOW()) +); + +CREATE UNIQUE INDEX agents_agent_name_uix +ON core.agents(UPPER(agent_name)); + +INSERT INTO core.agents(agent_code, agent_name, address, contact_number, commission_rate, account_id) +SELECT 'OFF', 'Office', 'Office', '', 0, (SELECT account_id FROM core.accounts WHERE account_code='20100'); + +CREATE VIEW core.agent_view +AS +SELECT + agent_id, + agent_code, + agent_name, + address, + contact_number, + commission_rate, + account_name +FROM + core.agents, + core.accounts +WHERE + core.agents.account_id = core.accounts.account_id; + +CREATE TABLE core.bonus_slabs +( + bonus_slab_id SERIAL NOT NULL PRIMARY KEY, + bonus_slab_code national character varying(12) NOT NULL, + bonus_slab_name national character varying(50) NOT NULL, + checking_frequency_id integer NOT NULL REFERENCES core.frequencies(frequency_id), + audit_user_id integer NULL REFERENCES office.users(user_id), + audit_ts TIMESTAMP WITH TIME ZONE NULL DEFAULT(NOW()) +); + +CREATE UNIQUE INDEX bonus_slabs_bonus_slab_code_uix +ON core.bonus_slabs(UPPER(bonus_slab_code)); + + +CREATE UNIQUE INDEX bonus_slabs_bonus_slab_name_uix +ON core.bonus_slabs(UPPER(bonus_slab_name)); + + +CREATE VIEW core.bonus_slab_view +AS +SELECT + bonus_slab_id, + bonus_slab_code, + bonus_slab_name, + checking_frequency_id, + frequency_name +FROM +core.bonus_slabs, core.frequencies +WHERE +core.bonus_slabs.checking_frequency_id = core.frequencies.frequency_id; + +CREATE TABLE core.bonus_slab_details +( + bonus_slab_detail_id SERIAL NOT NULL PRIMARY KEY, + bonus_slab_id integer NOT NULL REFERENCES core.bonus_slabs(bonus_slab_id), + amount_from money_strict NOT NULL, + amount_to money_strict NOT NULL, + bonus_rate decimal_strict NOT NULL, + audit_user_id integer NULL REFERENCES office.users(user_id), + audit_ts TIMESTAMP WITH TIME ZONE NULL DEFAULT(NOW()), + CONSTRAINT bonus_slab_details_amounts_chk CHECK(amount_to>amount_from) +); + + +CREATE VIEW core.bonus_slab_detail_view +AS +SELECT + bonus_slab_detail_id, + core.bonus_slab_details.bonus_slab_id, + core.bonus_slabs.bonus_slab_name AS slab_name, + amount_from, + amount_to, + bonus_rate +FROM + core.bonus_slab_details, + core.bonus_slabs +WHERE + core.bonus_slab_details.bonus_slab_id = core.bonus_slabs.bonus_slab_id; + +CREATE TABLE core.agent_bonus_setups +( + agent_bonus_setup_id SERIAL NOT NULL PRIMARY KEY, + agent_id integer NOT NULL REFERENCES core.agents(agent_id), + bonus_slab_id integer NOT NULL REFERENCES core.bonus_slabs(bonus_slab_id) +); + +CREATE UNIQUE INDEX agent_bonus_setups_uix +ON core.agent_bonus_setups(agent_id, bonus_slab_id); + + +CREATE VIEW core.agent_bonus_setup_view +AS +SELECT + agent_bonus_setup_id, + agent_name, + bonus_slab_name +FROM + core.agent_bonus_setups, + core.agents, + core.bonus_slabs +WHERE + core.agent_bonus_setups.agent_id = core.agents.agent_id +AND + core.agent_bonus_setups.bonus_slab_id = core.bonus_slabs.bonus_slab_id; + +CREATE TABLE core.ageing_slabs +( + ageing_slab_id SERIAL NOT NULL PRIMARY KEY, + ageing_slab_name national character varying(24) NOT NULL, + from_days integer NOT NULL, + to_days integer NOT NULL CHECK(to_days > 0) +); + +CREATE UNIQUE INDEX ageing_slabs_ageing_slab_name_uix +ON core.ageing_slabs(UPPER(ageing_slab_name)); + +INSERT INTO core.ageing_slabs(ageing_slab_name,from_days,to_days) +SELECT 'SLAB 1',0, 30 UNION ALL +SELECT 'SLAB 2',31, 60 UNION ALL +SELECT 'SLAB 3',61, 90 UNION ALL +SELECT 'SLAB 4',91, 365 UNION ALL +SELECT 'SLAB 5',366, 999999; + + +CREATE TABLE core.party_types +( + party_type_id SERIAL NOT NULL PRIMARY KEY, + party_type_code national character varying(12) NOT NULL, + party_type_name national character varying(50) NOT NULL, + is_supplier boolean NOT NULL CONSTRAINT party_types_is_supplier_df DEFAULT(false), + audit_user_id integer NULL REFERENCES office.users(user_id), + audit_ts TIMESTAMP WITH TIME ZONE NULL DEFAULT(NOW()) +); + +INSERT INTO core.party_types(party_type_code, party_type_name) SELECT 'A', 'Agent'; +INSERT INTO core.party_types(party_type_code, party_type_name) SELECT 'C', 'Customer'; +INSERT INTO core.party_types(party_type_code, party_type_name) SELECT 'D', 'Dealer'; +INSERT INTO core.party_types(party_type_code, party_type_name, is_supplier) SELECT 'S', 'Supplier', true; + +CREATE TABLE core.parties +( + party_id BIGSERIAL NOT NULL PRIMARY KEY, + party_type_id smallint NOT NULL REFERENCES core.party_types(party_type_id), + party_code national character varying(12) NULL, + first_name national character varying(50) NOT NULL, + middle_name national character varying(50) NULL, + last_name national character varying(50) NOT NULL, + party_name text NULL, + date_of_birth date NULL, + address_line_1 national character varying(128) NULL, + address_line_2 national character varying(128) NULL, + street national character varying(50) NULL, + city national character varying(50) NULL, + state national character varying(50) NULL, + country national character varying(50) NULL, + phone national character varying(24) NULL, + fax national character varying(24) NULL, + cell national character varying(24) NULL, + email national character varying(128) NULL, + url national character varying(50) NULL, + pan_number national character varying(50) NULL, + sst_number national character varying(50) NULL, + cst_number national character varying(50) NULL, + allow_credit boolean NULL, + maximum_credit_period smallint NULL, + maximum_credit_amount money_strict2 NULL, + charge_interest boolean NULL, + interest_rate decimal NULL, + interest_compounding_frequency_id smallint NULL REFERENCES core.frequencies(frequency_id), + account_id integer NOT NULL REFERENCES core.accounts(account_id), + audit_user_id integer NULL REFERENCES office.users(user_id), + audit_ts TIMESTAMP WITH TIME ZONE NULL DEFAULT(NOW()) +); + + +CREATE UNIQUE INDEX parties_party_code_uix +ON core.parties(UPPER(party_code)); + +/******************************************************************* + GET UNIQUE EIGHT-TO-TEN DIGIT CUSTOMER CODE + TO IDENTIFY A PARTY. + BASIC FORMULA: + 1. FIRST TWO LETTERS OF FIRST NAME + 2. FIRST LETTER OF MIDDLE NAME (IF AVAILABLE) + 3. FIRST TWO LETTERS OF LAST NAME + 4. CUSTOMER NUMBER +*******************************************************************/ + +CREATE OR REPLACE FUNCTION core.get_party_code +( + text, --First Name + text, --Middle Name + text --Last Name +) +RETURNS text AS +$$ + DECLARE _party_code TEXT; +BEGIN + SELECT INTO + _party_code + party_code + FROM + core.parties + WHERE + party_code LIKE + UPPER(left($1,2) || + CASE + WHEN $2 IS NULL or $2 = '' + THEN left($3,3) + ELSE + left($2,1) || left($3,2) + END + || '%') + ORDER BY party_code desc + LIMIT 1; + + _party_code := + UPPER + ( + left($1,2)|| + CASE + WHEN $2 IS NULL or $2 = '' + THEN left($3,3) + ELSE + left($2,1)||left($3,2) + END + ) + || '-' || + CASE + WHEN _party_code IS NULL + THEN '0001' + ELSE + to_char(CAST(right(_party_code,4) AS integer)+1,'FM0000') + END; + RETURN _party_code; +END; +$$ +LANGUAGE 'plpgsql'; + + +CREATE FUNCTION core.update_party_code() +RETURNS trigger +AS +$$ +BEGIN + UPDATE core.parties + SET + party_code=core.get_party_code(NEW.first_name, NEW.middle_name, NEW.last_name) + WHERE core.parties.party_id=NEW.party_id; + + RETURN NEW; +END +$$ +LANGUAGE plpgsql; + +CREATE TRIGGER update_party_code +AFTER INSERT +ON core.parties +FOR EACH ROW EXECUTE PROCEDURE core.update_party_code(); + + +CREATE FUNCTION core.get_party_type_id_by_party_code(text) +RETURNS smallint +AS +$$ +BEGIN + RETURN + ( + SELECT + party_type_id + FROM + core.parties + WHERE + core.parties.party_code=$1 + ); +END +$$ +LANGUAGE plpgsql; + + +CREATE FUNCTION core.get_party_id_by_party_code(text) +RETURNS smallint +AS +$$ +BEGIN + RETURN + ( + SELECT + party_id + FROM + core.parties + WHERE + core.parties.party_code=$1 + ); +END +$$ +LANGUAGE plpgsql; + +CREATE VIEW core.party_view +AS +SELECT + core.parties.party_id, + core.party_types.party_type_code || ' (' || core.party_types.party_type_name || ')' AS party_type, + core.parties.party_code, + core.parties.first_name, + core.parties.middle_name, + core.parties.last_name, + core.parties.party_name, + core.parties.address_line_1, + core.parties.address_line_2, + core.parties.street, + core.parties.city, + core.parties.state, + core.parties.country, + core.parties.allow_credit, + core.parties.maximum_credit_period, + core.parties.maximum_credit_amount, + core.parties.charge_interest, + core.parties.interest_rate, + core.parties.pan_number, + core.parties.sst_number, + core.parties.cst_number, + core.parties.phone, + core.parties.fax, + core.parties.cell, + core.parties.email, + core.parties.url +FROM +core.parties +INNER JOIN +core.party_types +ON core.parties.party_type_id = core.party_types.party_type_id; + +CREATE FUNCTION core.is_supplier(int) +RETURNS boolean +AS +$$ +BEGIN + IF EXISTS + ( + SELECT 1 FROM core.parties + INNER JOIN core.party_types + ON core.parties.party_type_id=core.party_types.party_type_id + WHERE core.parties.party_id=$1 + AND core.party_types.is_supplier=true + ) THEN + RETURN true; + END IF; + + RETURN false; +END +$$ +LANGUAGE plpgsql; + +CREATE TABLE core.shipping_addresses +( + shipping_address_id BIGSERIAL NOT NULL PRIMARY KEY, + shipping_address_code national character varying(24) NOT NULL, + party_id bigint NOT NULL REFERENCES core.parties(party_id), + address_line_1 national character varying(128) NULL, + address_line_2 national character varying(128) NULL, + street national character varying(128) NULL, + city national character varying(128) NOT NULL, + state national character varying(128) NOT NULL, + country national character varying(128) NOT NULL, + audit_user_id integer NULL REFERENCES office.users(user_id), + audit_ts TIMESTAMP WITH TIME ZONE NULL DEFAULT(NOW()) +); + +CREATE UNIQUE INDEX shipping_addresses_shipping_address_code_uix +ON core.shipping_addresses(UPPER(shipping_address_code), party_id); + +CREATE FUNCTION core.get_shipping_address_id_by_shipping_address_code(text) +RETURNS smallint +AS +$$ +BEGIN + RETURN + ( + SELECT + shipping_address_id + FROM + core.shipping_addresses + WHERE + core.shipping_addresses.shipping_address_code=$1 + ); +END +$$ +LANGUAGE plpgsql; + +CREATE FUNCTION core.update_shipping_address_code_trigger() +RETURNS TRIGGER +AS +$$ +DECLARE _counter integer; +BEGIN + IF TG_OP='INSERT' THEN + + SELECT COALESCE(MAX(shipping_address_code::integer), 0) + 1 + INTO _counter + FROM core.shipping_addresses + WHERE party_id=NEW.party_id; + + NEW.shipping_address_code := trim(to_char(_counter, '000')); + + RETURN NEW; + END IF; +END +$$ +LANGUAGE plpgsql; + + +CREATE TRIGGER update_shipping_address_code_trigger +BEFORE INSERT +ON core.shipping_addresses +FOR EACH ROW EXECUTE PROCEDURE core.update_shipping_address_code_trigger(); + +CREATE VIEW core.shipping_address_view +AS +SELECT + core.shipping_addresses.shipping_address_id, + core.shipping_addresses.shipping_address_code, + core.shipping_addresses.party_id, + core.parties.party_code || ' (' || core.parties.party_name || ')' AS party, + core.shipping_addresses.address_line_1, + core.shipping_addresses.address_line_2, + core.shipping_addresses.street, + core.shipping_addresses.city, + core.shipping_addresses.state, + core.shipping_addresses.country +FROM core.shipping_addresses +INNER JOIN core.parties +ON core.shipping_addresses.party_id=core.parties.party_id; + +CREATE TABLE core.brands +( + brand_id SERIAL NOT NULL PRIMARY KEY, + brand_code national character varying(12) NOT NULL, + brand_name national character varying(150) NOT NULL +); + +CREATE UNIQUE INDEX brands_brand_code_uix +ON core.brands(UPPER(brand_code)); + +CREATE UNIQUE INDEX brands_brand_name_uix +ON core.brands(UPPER(brand_name)); + +INSERT INTO core.brands(brand_code, brand_name) +SELECT 'DEF', 'Default'; + + +CREATE TABLE core.shippers +( + shipper_id BIGSERIAL NOT NULL PRIMARY KEY, + shipper_code national character varying(12) NULL, + company_name national character varying(128) NOT NULL, + shipper_name national character varying(150) NULL, + address_line_1 national character varying(128) NULL, + address_line_2 national character varying(128) NULL, + street national character varying(50) NULL, + city national character varying(50) NULL, + state national character varying(50) NULL, + country national character varying(50) NULL, + phone national character varying(50) NULL, + fax national character varying(50) NULL, + cell national character varying(50) NULL, + email national character varying(128) NULL, + url national character varying(50) NULL, + contact_person national character varying(50) NULL, + contact_address_line_1 national character varying(128) NULL, + contact_address_line_2 national character varying(128) NULL, + contact_street national character varying(50) NULL, + contact_city national character varying(50) NULL, + contact_state national character varying(50) NULL, + contact_country national character varying(50) NULL, + contact_email national character varying(128) NULL, + contact_phone national character varying(50) NULL, + contact_cell national character varying(50) NULL, + factory_address national character varying(250) NULL, + pan_number national character varying(50) NULL, + sst_number national character varying(50) NULL, + cst_number national character varying(50) NULL, + account_id integer NOT NULL REFERENCES core.accounts(account_id), + audit_user_id integer NULL REFERENCES office.users(user_id), + audit_ts TIMESTAMP WITH TIME ZONE NULL DEFAULT(NOW()) +); + + +CREATE UNIQUE INDEX shippers_shipper_code_uix +ON core.shippers(UPPER(shipper_code)); + + +/******************************************************************* + GET UNIQUE EIGHT-TO-TEN DIGIT shipper CODE + TO IDENTIFY A shipper. + BASIC FORMULA: + 1. FIRST TWO LETTERS OF FIRST NAME + 2. FIRST LETTER OF MIDDLE NAME (IF AVAILABLE) + 3. FIRST TWO LETTERS OF LAST NAME + 4. shipper NUMBER +*******************************************************************/ + +CREATE OR REPLACE FUNCTION core.get_shipper_code +( + text --company name +) +RETURNS text AS +$$ + DECLARE __shipper_code TEXT; +BEGIN + SELECT INTO + __shipper_code + shipper_code + FROM + core.shippers + WHERE + shipper_code LIKE + UPPER(left($1, 3) || '%') + ORDER BY shipper_code desc + LIMIT 1; + + __shipper_code := + UPPER + ( + left($1,3) + ) + || '-' || + CASE + WHEN __shipper_code IS NULL + THEN '0001' + ELSE + to_char(CAST(right(__shipper_code, 4) AS integer)+1,'FM0000') + END; + RETURN __shipper_code; +END; +$$ +LANGUAGE 'plpgsql'; + +CREATE FUNCTION core.update_shipper_code() +RETURNS trigger +AS +$$ +BEGIN + UPDATE core.shippers + SET + shipper_code=core.get_shipper_code(NEW.company_name) + WHERE core.shippers.shipper_id=NEW.shipper_id; + + RETURN NEW; +END +$$ +LANGUAGE plpgsql; + +CREATE TRIGGER update_shipper_code +AFTER INSERT +ON core.shippers +FOR EACH ROW EXECUTE PROCEDURE core.update_shipper_code(); + + +CREATE FUNCTION core.get_account_id_by_shipper_id(integer) +RETURNS integer +AS +$$ +BEGIN + RETURN + ( + SELECT + core.shippers.account_id + FROM + core.shippers + WHERE + core.shippers.shipper_id=$1 + ); +END +$$ +LANGUAGE plpgsql; + + +CREATE TABLE core.tax_types +( + tax_type_id SERIAL NOT NULL PRIMARY KEY, + tax_type_code national character varying(12) NOT NULL, + tax_type_name national character varying(50) NOT NULL, + audit_user_id integer NULL REFERENCES office.users(user_id), + audit_ts TIMESTAMP WITH TIME ZONE NULL DEFAULT(NOW()) +); + +CREATE UNIQUE INDEX tax_types_tax_type_code_uix +ON core.tax_types(UPPER(tax_type_code)); + +CREATE UNIQUE INDEX tax_types_tax_type_name_uix +ON core.tax_types(UPPER(tax_type_name)); + +INSERT INTO core.tax_types(tax_type_code, tax_type_name) +SELECT 'DEF', 'Default'; + +CREATE TABLE core.taxes +( + tax_id SERIAL NOT NULL PRIMARY KEY, + tax_type_id smallint NOT NULL REFERENCES core.tax_types(tax_type_id), + tax_code national character varying(12) NOT NULL, + tax_name national character varying(50) NOT NULL, + rate decimal NOT NULL, + account_id integer NOT NULL REFERENCES core.accounts(account_id), + audit_user_id integer NULL REFERENCES office.users(user_id), + audit_ts TIMESTAMP WITH TIME ZONE NULL DEFAULT(NOW()) +); + + + +CREATE UNIQUE INDEX taxes_tax_code_uix +ON core.taxes(UPPER(tax_code)); + +CREATE UNIQUE INDEX taxes_tax_name_uix +ON core.taxes(UPPER(tax_name)); + +INSERT INTO core.taxes(tax_type_id, tax_code, tax_name, rate, account_id) +SELECT 1, 'VAT', 'Value Added Tax', 13, (SELECT account_id FROM core.accounts WHERE account_name='Sales Tax Payable') UNION ALL +SELECT 1, 'SAT', 'Sales Tax', 5, (SELECT account_id FROM core.accounts WHERE account_name='Sales Tax Payable'); + +CREATE VIEW core.tax_view +AS +SELECT + tax_id, + tax_code, + tax_name, + rate, + tax_type_code, + tax_type_name, + account_code, + account_name +FROM + core.taxes, + core.accounts, + core.tax_types +WHERE + core.taxes.account_id = core.accounts.account_id +AND + core.taxes.tax_type_id = core.tax_types.tax_type_id; + +CREATE TABLE core.item_groups +( + item_group_id SERIAL NOT NULL PRIMARY KEY, + item_group_code national character varying(12) NOT NULL, + item_group_name national character varying(50) NOT NULL, + exclude_from_purchase boolean NOT NULL CONSTRAINT item_groups_exclude_from_purchase_df DEFAULT('No'), + exclude_from_sales boolean NOT NULL CONSTRAINT item_groups_exclude_from_sales_df DEFAULT('No'), + tax_id smallint NOT NULL REFERENCES core.taxes(tax_id), + audit_user_id integer NULL REFERENCES office.users(user_id), + audit_ts TIMESTAMP WITH TIME ZONE NULL DEFAULT(NOW()) +); + + +CREATE UNIQUE INDEX item_groups_item_group_code_uix +ON core.item_groups(UPPER(item_group_code)); + +CREATE UNIQUE INDEX item_groups_item_group_name_uix +ON core.item_groups(UPPER(item_group_name)); + +INSERT INTO core.item_groups(item_group_code, item_group_name, tax_id) +SELECT 'DEF', 'Default', 1; + + +CREATE TABLE core.items +( + item_id SERIAL NOT NULL PRIMARY KEY, + item_code national character varying(12) NOT NULL, + item_name national character varying(150) NOT NULL, + item_group_id integer NOT NULL REFERENCES core.item_groups(item_group_id), + brand_id integer NOT NULL REFERENCES core.brands(brand_id), + preferred_supplier_id integer NULL REFERENCES core.parties(party_id) + CONSTRAINT items_preferred_supplier_id_chk CHECK(core.is_supplier(preferred_supplier_id) = true), + lead_time_in_days integer NOT NULL DEFAULT(0), + unit_id integer NOT NULL REFERENCES core.units(unit_id), + hot_item boolean NOT NULL, + cost_price money_strict NOT NULL, + cost_price_includes_tax boolean NOT NULL CONSTRAINT items_cost_price_includes_tax_df DEFAULT('No'), + selling_price money_strict NOT NULL, + selling_price_includes_tax boolean NOT NULL CONSTRAINT items_selling_price_includes_tax_df DEFAULT('No'), + tax_id integer NOT NULL REFERENCES core.taxes(tax_id), + reorder_level integer NOT NULL, + item_image image_path NULL, + maintain_stock boolean NOT NULL DEFAULT(true), + audit_user_id integer NULL REFERENCES office.users(user_id), + audit_ts TIMESTAMP WITH TIME ZONE NULL DEFAULT(NOW()) +); + +CREATE UNIQUE INDEX items_item_name_uix +ON core.items(UPPER(item_name)); + +CREATE FUNCTION core.get_item_id_by_item_code(text) +RETURNS integer +AS +$$ +BEGIN + RETURN + ( + SELECT + item_id + FROM + core.items + WHERE + core.items.item_code=$1 + ); +END +$$ +LANGUAGE plpgsql; + +CREATE FUNCTION core.get_item_tax_rate(integer) +RETURNS decimal +AS +$$ +BEGIN + RETURN + COALESCE(( + SELECT core.taxes.rate + FROM core.taxes + INNER JOIN core.items + ON core.taxes.tax_id = core.items.tax_id + WHERE core.items.item_id=$1 + ), 0); +END +$$ +LANGUAGE plpgsql; + +--TODO +CREATE VIEW core.item_view +AS +SELECT * FROM core.items; + + +/******************************************************************* + PLEASE NOTE : + + THESE ARE THE MOST EFFECTIVE STOCK ITEM PRICES. + THE PRICE IN THIS CATALOG IS ACTUALLY + PICKED UP AT THE TIME OF PURCHASE AND SALES. + + A STOCK ITEM PRICE MAY BE DIFFERENT FOR DIFFERENT units. + FURTHER, A STOCK ITEM WOULD BE SOLD AT A HIGHER PRICE + WHEN SOLD LOOSE THAN WHAT IT WOULD ACTUALLY COST IN A + COMPOUND UNIT. + + EXAMPLE, ONE CARTOON (20 BOTTLES) OF BEER BOUGHT AS A UNIT + WOULD COST 25% LESS FROM THE SAME STORE. + +*******************************************************************/ + +CREATE TABLE core.item_selling_prices +( + item_selling_price_id BIGSERIAL NOT NULL PRIMARY KEY, + item_id integer NOT NULL REFERENCES core.items(item_id), + unit_id integer NOT NULL REFERENCES core.units(unit_id), + party_type_id smallint NULL REFERENCES core.party_types(party_type_id), + price_type_id smallint NULL REFERENCES core.price_types(price_type_id), + includes_tax boolean NOT NULL CONSTRAINT item_selling_prices_includes_tax_df DEFAULT('No'), + price money_strict NOT NULL, + audit_user_id integer NULL REFERENCES office.users(user_id), + audit_ts TIMESTAMP WITH TIME ZONE NULL DEFAULT(NOW()) +); + + +CREATE VIEW core.item_selling_price_view +AS +SELECT + core.item_selling_prices.item_selling_price_id, + core.items.item_code, + core.items.item_name, + core.party_types.party_type_code, + core.party_types.party_type_name, + price +FROM + core.item_selling_prices +INNER JOIN core.items +ON + core.item_selling_prices.item_id = core.items.item_id +LEFT JOIN + core.price_types +ON + core.item_selling_prices.price_type_id = core.price_types.price_type_id +LEFT JOIN + core.party_types +ON core.item_selling_prices.party_type_id = core.party_types.party_type_id; + + + +CREATE TABLE core.item_cost_prices +( + item_cost_price_id BIGSERIAL NOT NULL PRIMARY KEY, + item_id integer NOT NULL REFERENCES core.items(item_id), + entry_ts TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT(now()), + unit_id integer NOT NULL REFERENCES core.units(unit_id), + party_id bigint NULL REFERENCES core.parties(party_id), + lead_time_in_days integer NOT NULL DEFAULT(0), + includes_tax boolean NOT NULL CONSTRAINT item_cost_prices_includes_tax_df DEFAULT('No'), + price money_strict NOT NULL, + audit_user_id integer NULL REFERENCES office.users(user_id), + audit_ts TIMESTAMP WITH TIME ZONE NULL DEFAULT(NOW()) +); + + +CREATE VIEW core.item_cost_price_view +AS +SELECT + core.item_cost_prices.item_cost_price_id, + core.items.item_code, + core.items.item_name, + core.parties.party_code, + core.parties.party_name, + core.item_cost_prices.price +FROM +core.item_cost_prices +INNER JOIN +core.items +ON core.item_cost_prices.item_id = core.items.item_id +LEFT JOIN +core.parties +ON core.item_cost_prices.party_id = core.parties.party_id; + +CREATE FUNCTION core.get_item_cost_price(item_id_ integer, unit_id_ integer, party_id_ bigint) +RETURNS money +AS +$$ + DECLARE _price money; + DECLARE _unit_id integer; + DECLARE _factor decimal; + DECLARE _tax_rate decimal; + DECLARE _includes_tax boolean; + DECLARE _tax money; +BEGIN + --Fist pick the catalog price which matches all these fields: + --Item, Unit, and Supplier. + --This is the most effective price. + SELECT + item_cost_prices.price, + item_cost_prices.unit_id, + item_cost_prices.includes_tax + INTO + _price, + _unit_id, + _includes_tax + FROM core.item_cost_prices + WHERE item_cost_prices.item_id = $1 + AND item_cost_prices.unit_id = $2 + AND item_cost_prices.party_id =$3; + + IF(_unit_id IS NULL) THEN + --We do not have a cost price of this item for the unit supplied. + --Let's see if this item has a price for other units. + SELECT + item_cost_prices.price, + item_cost_prices.unit_id, + item_cost_prices.includes_tax + INTO + _price, + _unit_id, + _includes_tax + FROM core.item_cost_prices + WHERE item_cost_prices.item_id=$1 + AND item_cost_prices.party_id =$3; + END IF; + + + IF(_price IS NULL) THEN + --This item does not have cost price defined in the catalog. + --Therefore, getting the default cost price from the item definition. + SELECT + cost_price, + unit_id, + cost_price_includes_tax + INTO + _price, + _unit_id, + _includes_tax + FROM core.items + WHERE core.items.item_id = $1; + END IF; + + IF(_includes_tax) THEN + _tax_rate := core.get_item_tax_rate($1); + _price := _price / ((100 + _tax_rate)/ 100); + END IF; + + --Get the unitary conversion factor if the requested unit does not match with the price defition. + _factor := core.convert_unit($2, _unit_id); + + RETURN _price * _factor; +END +$$ +LANGUAGE plpgsql; + + +CREATE TABLE office.store_types +( + store_type_id SERIAL NOT NULL PRIMARY KEY, + store_type_code national character varying(12) NOT NULL, + store_type_name national character varying(50) NOT NULL, + audit_user_id integer NULL REFERENCES office.users(user_id), + audit_ts TIMESTAMP WITH TIME ZONE NULL DEFAULT(NOW()) +); + +CREATE UNIQUE INDEX store_types_Code_uix +ON office.store_types(UPPER(store_type_code)); + + +CREATE UNIQUE INDEX store_types_Name_uix +ON office.store_types(UPPER(store_type_name)); + +INSERT INTO office.store_types(store_type_code,store_type_name) +SELECT 'GOD', 'Godown' UNION ALL +SELECT 'SAL', 'Sales Center' UNION ALL +SELECT 'WAR', 'Warehouse' UNION ALL +SELECT 'PRO', 'Production'; + + +CREATE TABLE office.stores +( + store_id SERIAL NOT NULL PRIMARY KEY, + office_id integer NOT NULL REFERENCES office.offices(office_id), + store_code national character varying(12) NOT NULL, + store_name national character varying(50) NOT NULL, + address national character varying(50) NULL, + store_type_id integer NOT NULL REFERENCES office.store_types(store_type_id), + allow_sales boolean NOT NULL DEFAULT(true), + audit_user_id integer NULL REFERENCES office.users(user_id), + audit_ts TIMESTAMP WITH TIME ZONE NULL DEFAULT(NOW()) +); + + +CREATE UNIQUE INDEX stores_store_code_uix +ON office.stores(UPPER(store_code)); + +CREATE UNIQUE INDEX stores_store_name_uix +ON office.stores(UPPER(store_name)); + + +--TODO +CREATE VIEW office.store_view +AS +SELECT * FROM office.stores; + + +CREATE TABLE office.cash_repositories +( + cash_repository_id BIGSERIAL NOT NULL PRIMARY KEY, + office_id integer NOT NULL REFERENCES office.offices(office_id), + cash_repository_code national character varying(12) NOT NULL, + cash_repository_name national character varying(50) NOT NULL, + parent_cash_repository_id integer NULL REFERENCES office.cash_repositories(cash_repository_id), + description national character varying(100) NULL, + audit_user_id integer NULL REFERENCES office.users(user_id), + audit_ts TIMESTAMP WITH TIME ZONE NULL DEFAULT(NOW()) +); + + +CREATE UNIQUE INDEX cash_repositories_cash_repository_code_uix +ON office.cash_repositories(UPPER(cash_repository_code)); + +CREATE UNIQUE INDEX cash_repositories_cash_repository_name_uix +ON office.cash_repositories(UPPER(cash_repository_name)); + +CREATE FUNCTION office.get_cash_repository_id_by_cash_repository_code(text) +RETURNS integer +AS +$$ +BEGIN + RETURN + ( + SELECT cash_repository_id + FROM office.cash_repositories + WHERE cash_repository_code=$1 + ); +END +$$ +LANGUAGE plpgsql; + +CREATE FUNCTION office.get_cash_repository_id_by_cash_repository_name(text) +RETURNS integer +AS +$$ +BEGIN + RETURN + ( + SELECT cash_repository_id + FROM office.cash_repositories + WHERE cash_repository_name=$1 + ); +END +$$ +LANGUAGE plpgsql; + + + +CREATE VIEW office.cash_repository_view +AS +SELECT + office.cash_repositories.cash_repository_id, + office.cash_repositories.cash_repository_code, + office.cash_repositories.cash_repository_name, + parent_cash_repositories.cash_repository_code parent_cr_code, + parent_cash_repositories.cash_repository_name parent_cr_name, + office.cash_repositories.description +FROM + office.cash_repositories +LEFT OUTER JOIN + office.cash_repositories AS parent_cash_repositories +ON + office.cash_repositories.parent_cash_repository_id=parent_cash_repositories.cash_repository_id; + +CREATE TABLE office.counters +( + counter_id SERIAL NOT NULL PRIMARY KEY, + store_id smallint NOT NULL REFERENCES office.stores(store_id), + cash_repository_id integer NOT NULL REFERENCES office.cash_repositories(cash_repository_id), + counter_code national character varying(12) NOT NULL, + counter_name national character varying(50) NOT NULL, + audit_user_id integer NULL REFERENCES office.users(user_id), + audit_ts TIMESTAMP WITH TIME ZONE NULL DEFAULT(NOW()) +); + + +CREATE UNIQUE INDEX counters_counter_code_uix +ON office.counters(UPPER(counter_code)); + +CREATE UNIQUE INDEX counters_counter_name_uix +ON office.counters(UPPER(counter_name)); + + +CREATE TABLE office.cost_centers +( + cost_center_id SERIAL NOT NULL PRIMARY KEY, + cost_center_code national character varying(24) NOT NULL, + cost_center_name national character varying(50) NOT NULL, + audit_user_id integer NULL REFERENCES office.users(user_id), + audit_ts TIMESTAMP WITH TIME ZONE NULL DEFAULT(NOW()) +); + +CREATE UNIQUE INDEX cost_centers_cost_center_code_uix +ON office.cost_centers(UPPER(cost_center_code)); + +CREATE UNIQUE INDEX cost_centers_cost_center_name_uix +ON office.cost_centers(UPPER(cost_center_name)); + +INSERT INTO office.cost_centers(cost_center_code, cost_center_name) +SELECT 'DEF', 'Default' UNION ALL +SELECT 'GEN', 'General Administration' UNION ALL +SELECT 'HUM', 'Human Resources' UNION ALL +SELECT 'SCC', 'Support & Customer Care' UNION ALL +SELECT 'GAE', 'Guest Accomodation & Entertainment' UNION ALL +SELECT 'MKT', 'Marketing & Promotion' UNION ALL +SELECT 'SAL', 'Sales & Billing' UNION ALL +SELECT 'FIN', 'Finance & Accounting'; + +CREATE VIEW office.cost_center_view +AS +SELECT + office.cost_centers.cost_center_id, + office.cost_centers.cost_center_code, + office.cost_centers.cost_center_name +FROM + office.cost_centers; + + +CREATE TABLE office.cashiers +( + cashier_id BIGSERIAL NOT NULL PRIMARY KEY, + counter_id integer NOT NULL REFERENCES office.counters(counter_id), + user_id integer NOT NULL REFERENCES office.users(user_id), + assigned_by_user_id integer NOT NULL REFERENCES office.users(user_id), + transaction_date date NOT NULL, + closed boolean NOT NULL +); + +CREATE UNIQUE INDEX Cashiers_user_id_TDate_uix +ON office.cashiers(user_id ASC, transaction_date DESC); + + +/******************************************************************* + STORE policy DEFINES THE RIGHT OF USERS TO ACCESS A STORE. + AN ADMINISTRATOR CAN ACCESS ALL THE stores, BY DEFAULT. +*******************************************************************/ + + +CREATE TABLE policy.store_policies +( + store_policy_id BIGSERIAL NOT NULL PRIMARY KEY, + written_by_user_id integer NOT NULL REFERENCES office.users(user_id), + status boolean NOT NULL, + audit_user_id integer NULL REFERENCES office.users(user_id), + audit_ts TIMESTAMP WITH TIME ZONE NULL DEFAULT(NOW()) +); + +CREATE TABLE policy.store_policy_details +( + store_policy_detail_id BIGSERIAL NOT NULL PRIMARY KEY, + store_policy_id integer NOT NULL REFERENCES policy.store_policies(store_policy_id), + user_id integer NOT NULL REFERENCES office.users(user_id), + store_id smallint NOT NULL REFERENCES office.stores(store_id), + audit_user_id integer NULL REFERENCES office.users(user_id), + audit_ts TIMESTAMP WITH TIME ZONE NULL DEFAULT(NOW()) +); + +CREATE TABLE core.item_opening_inventory +( + item_opening_inventory_id BIGSERIAL NOT NULL PRIMARY KEY, + entry_ts TIMESTAMP WITH TIME ZONE NOT NULL, + item_id integer NOT NULL REFERENCES core.items(item_id), + store_id smallint NOT NULL REFERENCES office.stores(store_id), + unit_id integer NOT NULL REFERENCES core.units(unit_id), + quantity integer NOT NULL, + amount money_strict NOT NULL, + base_unit_id integer NOT NULL REFERENCES core.units(unit_id), + base_quantity decimal NOT NULL, + audit_user_id integer NULL REFERENCES office.users(user_id), + audit_ts TIMESTAMP WITH TIME ZONE NULL DEFAULT(NOW()) +); + + +CREATE TABLE audit.history +( + activity_id BIGSERIAL NOT NULL PRIMARY KEY, + event_ts TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT(NOW()), + principal_user national character varying(50) NOT NULL DEFAULT(current_user), + user_id integer /*NOT*/ NULL REFERENCES office.users(user_id), + type national character varying(50) NOT NULL, + table_schema national character varying(50) NOT NULL, + table_name national character varying(50) NOT NULL, + primary_key_id national character varying(50) NOT NULL, + column_name national character varying(50) NOT NULL, + old_val text NULL, + new_val text NULL, + CONSTRAINT audit_history_val_chk + CHECK + ( + (old_val IS NULL AND new_val IS NOT NULL) OR + (old_val IS NOT NULL AND new_val IS NULL) OR + (old_val IS NOT NULL AND new_val IS NOT NULL) + ) +); + + +CREATE FUNCTION office.is_sys_user(integer) +RETURNS boolean +AS +$$ +BEGIN + IF EXISTS + ( + SELECT * FROM office.users + WHERE user_id=$1 + AND role_id IN + ( + SELECT office.roles.role_id FROM office.roles WHERE office.roles.role_code='SYST' + ) + ) THEN + RETURN true; + END IF; + + RETURN false; +END +$$ +LANGUAGE plpgsql; + + +/******************************************************************* + THIS FUNCTION RETURNS A NEW INCREMENTAL COUNTER SUBJECT + TO BE USED TO GENERATE TRANSACTION CODES +*******************************************************************/ + +CREATE FUNCTION transactions.get_new_transaction_counter(date) +RETURNS integer +AS +$$ + DECLARE _ret_val integer; +BEGIN + SELECT INTO _ret_val + COALESCE(MAX(transaction_counter),0) + FROM transactions.transaction_master + WHERE value_date=$1; + + IF _ret_val IS NULL THEN + RETURN 1::integer; + ELSE + RETURN (_ret_val + 1)::integer; + END IF; +END; +$$ +LANGUAGE plpgsql; + +CREATE FUNCTION transactions.get_transaction_code(value_date date, office_id integer, user_id integer, login_id bigint) +RETURNS text +AS +$$ + DECLARE _office_id bigint:=$2; + DECLARE _user_id integer:=$3; + DECLARE _login_id bigint:=$4; + DECLARE _ret_val text; +BEGIN + _ret_val:= transactions.get_new_transaction_counter($1)::text || '-' || TO_CHAR($1, 'YYYY-MM-DD') || '-' || CAST(_office_id as text) || '-' || CAST(_user_id as text) || '-' || CAST(_login_id as text) || '-' || TO_CHAR(now(), 'HH24-MI-SS'); + RETURN _ret_val; +END +$$ +LANGUAGE plpgsql; + + +CREATE TABLE transactions.transaction_master +( + transaction_master_id BIGSERIAL NOT NULL PRIMARY KEY, + transaction_counter integer NOT NULL, --Sequence of transactions of a date + transaction_code national character varying(50) NOT NULL, + book national character varying(50) NOT NULL, --Transaction book. Ex. Sales, Purchase, Journal + value_date date NOT NULL, + transaction_ts TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT(now()), + login_id bigint NOT NULL REFERENCES audit.logins(login_id), + user_id integer NOT NULL REFERENCES office.users(user_id), + sys_user_id integer NULL REFERENCES office.users(user_id) + CONSTRAINT transaction_master_sys_user_id_chk CHECK(sys_user_id IS NULL OR office.is_sys_user(sys_user_id)=true), + office_id integer NOT NULL REFERENCES office.offices(office_id), + cost_center_id integer NULL REFERENCES office.cost_centers(cost_center_id), + reference_number national character varying(24) NULL, + statement_reference text NULL, + last_verified_on TIMESTAMP WITH TIME ZONE NULL, + verified_by_user_id integer NULL REFERENCES office.users(user_id), + verification_status_id smallint NOT NULL REFERENCES core.verification_statuses(verification_status_id) DEFAULT(0/*Awaiting verification*/), + verification_reason national character varying(128) NOT NULL CONSTRAINT transaction_master_verification_reason_df DEFAULT(''), + audit_user_id integer NULL REFERENCES office.users(user_id), + audit_ts TIMESTAMP WITH TIME ZONE NULL DEFAULT(NOW()), + CONSTRAINT transaction_master_login_id_sys_user_id_chk + CHECK + ( + ( + login_id IS NULL AND sys_user_id IS NOT NULL + ) + + OR + + ( + login_id IS NOT NULL AND sys_user_id IS NULL + ) + ) +); + +CREATE UNIQUE INDEX transaction_master_transaction_code_uix +ON transactions.transaction_master(UPPER(transaction_code)); + + + +CREATE TABLE transactions.transaction_details +( + transaction_detail_id BIGSERIAL NOT NULL PRIMARY KEY, + transaction_master_id bigint NOT NULL REFERENCES transactions.transaction_master(transaction_master_id), + tran_type transaction_type NOT NULL, + account_id integer NOT NULL REFERENCES core.accounts(account_id), + statement_reference text NULL, + cash_repository_id integer NULL REFERENCES office.cash_repositories(cash_repository_id), + amount money_strict NOT NULL, + audit_user_id integer NULL REFERENCES office.users(user_id), + audit_ts TIMESTAMP WITH TIME ZONE NULL DEFAULT(NOW()) +); + +CREATE TABLE transactions.stock_master +( + stock_master_id BIGSERIAL NOT NULL PRIMARY KEY, + transaction_master_id bigint NOT NULL REFERENCES transactions.transaction_master(transaction_master_id), + party_id bigint NULL REFERENCES core.parties(party_id), + agent_id integer NULL REFERENCES core.agents(agent_id), + price_type_id integer NULL REFERENCES core.price_types(price_type_id), + is_credit boolean NOT NULL CONSTRAINT stock_master_is_credit_df DEFAULT(false), + shipper_id integer NULL REFERENCES core.shippers(shipper_id), + shipping_address_id integer NULL REFERENCES core.shipping_addresses(shipping_address_id), + shipping_charge money NOT NULL CONSTRAINT stock_master_shipping_charge_df DEFAULT(0), + store_id integer NULL REFERENCES office.stores(store_id), + cash_repository_id integer NULL REFERENCES office.cash_repositories(cash_repository_id), + audit_user_id integer NULL REFERENCES office.users(user_id), + audit_ts TIMESTAMP WITH TIME ZONE NULL DEFAULT(NOW()) +); + + +CREATE TABLE transactions.stock_details +( + stock_master_detail_id BIGSERIAL NOT NULL PRIMARY KEY, + stock_master_id bigint NOT NULL REFERENCES transactions.stock_master(stock_master_id), + tran_type transaction_type NOT NULL, + store_id integer NULL REFERENCES office.stores(store_id), + item_id integer NOT NULL REFERENCES core.items(item_id), + quantity integer NOT NULL, + unit_id integer NOT NULL REFERENCES core.units(unit_id), + base_quantity decimal NOT NULL, + base_unit_id integer NOT NULL REFERENCES core.units(unit_id), + price money_strict NOT NULL, + discount money NOT NULL CONSTRAINT stock_details_discount_df DEFAULT(0), + tax_rate decimal NOT NULL CONSTRAINT stock_details_tax_rate_df DEFAULT(0), + tax money NOT NULL CONSTRAINT stock_details_tax_df DEFAULT(0), + audit_user_id integer NULL REFERENCES office.users(user_id), + audit_ts TIMESTAMP WITH TIME ZONE NULL DEFAULT(NOW()) +); + +CREATE MATERIALIZED VIEW transactions.trial_balance_view +AS +SELECT core.get_account_name(account_id), + SUM(CASE transactions.transaction_details.tran_type WHEN 'Dr' THEN amount ELSE NULL END) AS debit, + SUM(CASE transactions.transaction_details.tran_type WHEN 'Cr' THEN amount ELSE NULL END) AS Credit +FROM transactions.transaction_details +GROUP BY account_id; + + +--TODO +CREATE TABLE transactions.non_gl_stock_master +( + non_gl_stock_master_id BIGSERIAL NOT NULL PRIMARY KEY, + value_date date NOT NULL, + book national character varying(48) NOT NULL, + party_id bigint NULL REFERENCES core.parties(party_id), + price_type_id integer NULL REFERENCES core.price_types(price_type_id), + transaction_ts TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT(now()), + login_id bigint NOT NULL REFERENCES audit.logins(login_id), + user_id integer NOT NULL REFERENCES office.users(user_id), + office_id integer NOT NULL REFERENCES office.offices(office_id), + reference_number national character varying(24) NULL, + statement_reference text NULL, + audit_user_id integer NULL REFERENCES office.users(user_id), + audit_ts TIMESTAMP WITH TIME ZONE NULL DEFAULT(NOW()) +); + + +CREATE TABLE transactions.non_gl_stock_details +( + non_gl_stock_details_id BIGSERIAL NOT NULL PRIMARY KEY, + non_gl_stock_master_id bigint NOT NULL REFERENCES transactions.non_gl_stock_master(non_gl_stock_master_id), + item_id integer NOT NULL REFERENCES core.items(item_id), + quantity integer NOT NULL, + unit_id integer NOT NULL REFERENCES core.units(unit_id), + base_quantity decimal NOT NULL, + base_unit_id integer NOT NULL REFERENCES core.units(unit_id), + price money_strict NOT NULL, + discount money NOT NULL CONSTRAINT non_gl_stock_details_discount_df DEFAULT(0), + tax_rate decimal NOT NULL CONSTRAINT non_gl_stock_details_tax_rate_df DEFAULT(0), + tax money NOT NULL CONSTRAINT non_gl_stock_details_tax_df DEFAULT(0), + audit_user_id integer NULL REFERENCES office.users(user_id), + audit_ts TIMESTAMP WITH TIME ZONE NULL DEFAULT(NOW()) +); + + +CREATE TABLE crm.lead_sources +( + lead_source_id SERIAL NOT NULL PRIMARY KEY, + lead_source_code national character varying(12) NOT NULL, + lead_source_name national character varying(128) NOT NULL, + audit_user_id integer NULL REFERENCES office.users(user_id), + audit_ts TIMESTAMP WITH TIME ZONE NULL DEFAULT(NOW()) +); + +CREATE UNIQUE INDEX lead_sources_lead_source_code_uix +ON crm.lead_sources(UPPER(lead_source_code)); + + +CREATE UNIQUE INDEX lead_sources_lead_source_name_uix +ON crm.lead_sources(UPPER(lead_source_name)); + +INSERT INTO crm.lead_sources(lead_source_code, lead_source_name) +SELECT 'AG', 'Agent' UNION ALL +SELECT 'CC', 'Cold Call' UNION ALL +SELECT 'CR', 'Customer Reference' UNION ALL +SELECT 'DI', 'Direct Inquiry' UNION ALL +SELECT 'EV', 'Events' UNION ALL +SELECT 'PR', 'Partner'; + +CREATE TABLE crm.lead_statuses +( + lead_status_id SERIAL NOT NULL PRIMARY KEY, + lead_status_code national character varying(12) NOT NULL, + lead_status_name national character varying(128) NOT NULL, + audit_user_id integer NULL REFERENCES office.users(user_id), + audit_ts TIMESTAMP WITH TIME ZONE NULL DEFAULT(NOW()) +); + +CREATE UNIQUE INDEX lead_statuses_lead_status_code_uix +ON crm.lead_statuses(UPPER(lead_status_code)); + + +CREATE UNIQUE INDEX lead_statuses_lead_status_name_uix +ON crm.lead_statuses(UPPER(lead_status_name)); + +INSERT INTO crm.lead_statuses(lead_status_code, lead_status_name) +SELECT 'CL', 'Cool' UNION ALL +SELECT 'CF', 'Contact in Future' UNION ALL +SELECT 'LO', 'Lost' UNION ALL +SELECT 'IP', 'In Prgress' UNION ALL +SELECT 'QF', 'Qualified'; + +CREATE TABLE crm.opportunity_stages +( + opportunity_stage_id SERIAL NOT NULL PRIMARY KEY, + opportunity_stage_code national character varying(12) NOT NULL, + opportunity_stage_name national character varying(50) NOT NULL, + audit_user_id integer NULL REFERENCES office.users(user_id), + audit_ts TIMESTAMP WITH TIME ZONE NULL DEFAULT(NOW()) +); + + +CREATE UNIQUE INDEX opportunity_stages_opportunity_stage_code_uix +ON crm.opportunity_stages(UPPER(opportunity_stage_code)); + +CREATE UNIQUE INDEX opportunity_stages_opportunity_stage_name_uix +ON crm.opportunity_stages(UPPER(opportunity_stage_name)); + + +INSERT INTO crm.opportunity_stages(opportunity_stage_code, opportunity_stage_name) +SELECT 'PRO', 'Prospecting' UNION ALL +SELECT 'QUA', 'Qualification' UNION ALL +SELECT 'NEG', 'Negotiating' UNION ALL +SELECT 'VER', 'Verbal' UNION ALL +SELECT 'CLW', 'Closed Won' UNION ALL +SELECT 'CLL', 'Closed Lost'; + +CREATE FUNCTION transactions.get_invoice_amount(transaction_master_id_ bigint) +RETURNS money +AS +$$ +DECLARE _shipping_charge money; +DECLARE _stock_total money; +BEGIN + SELECT SUM((quantity * price) + tax - discount) INTO _stock_total + FROM transactions.stock_details + WHERE transactions.stock_details.stock_master_id = + ( + SELECT transactions.stock_master.stock_master_id + FROM transactions.stock_master WHERE transactions.stock_master.transaction_master_id= $1 + ); + + SELECT shipping_charge INTO _shipping_charge + FROM transactions.stock_master + WHERE transactions.stock_master.transaction_master_id=$1; + + RETURN COALESCE(_stock_total + _shipping_charge, 0::money); +END +$$ +LANGUAGE plpgsql; + +CREATE FUNCTION core.count_item_in_stock(item_id_ integer, unit_id_ integer, store_id_ integer) +RETURNS decimal +AS +$$ + DECLARE _base_unit_id integer; + DECLARE _debit decimal; + DECLARE _credit decimal; + DECLARE _balance decimal; + DECLARE _factor decimal; +BEGIN + + --Get the base item unit + SELECT + core.get_root_unit_id(core.items.unit_id) + INTO _base_unit_id + FROM core.items + WHERE core.items.item_id=$1; + + --Get the sum of debit stock quantity from approved transactions + SELECT + COALESCE(SUM(base_quantity), 0) + INTO _debit + FROM transactions.stock_details + INNER JOIN transactions.stock_master + ON transactions.stock_master.stock_master_id = transactions.stock_details.stock_master_id + INNER JOIN transactions.transaction_master + ON transactions.stock_master.transaction_master_id = transactions.transaction_master.transaction_master_id + WHERE transactions.transaction_master.verification_status_id > 0 + AND transactions.stock_details.item_id=$1 + AND transactions.stock_details.store_id=$3 + AND transactions.stock_details.tran_type='Dr'; + + --Get the sum of credit stock quantity from approved transactions + SELECT + COALESCE(SUM(base_quantity), 0) + INTO _credit + FROM transactions.stock_details + INNER JOIN transactions.stock_master + ON transactions.stock_master.stock_master_id = transactions.stock_details.stock_master_id + INNER JOIN transactions.transaction_master + ON transactions.stock_master.transaction_master_id = transactions.transaction_master.transaction_master_id + WHERE transactions.transaction_master.verification_status_id > 0 + AND transactions.stock_details.item_id=$1 + AND transactions.stock_details.store_id=$3 + AND transactions.stock_details.tran_type='Cr'; + + _balance:= _debit - _credit; + + + _factor = core.convert_unit($2, _base_unit_id); + + return _balance / _factor; +END +$$ +LANGUAGE plpgsql; + +CREATE TABLE core.switch_categories +( + switch_category_id SERIAL NOT NULL PRIMARY KEY, + switch_category_name national character varying(128) NOT NULL, + audit_user_id integer NULL REFERENCES office.users(user_id), + audit_ts TIMESTAMP WITH TIME ZONE NULL DEFAULT(NOW()) +); + +CREATE UNIQUE INDEX switch_categories_switch_category_name_uix +ON core.switch_categories(UPPER(switch_category_name)); + +INSERT INTO core.switch_categories(switch_category_name) +SELECT 'General'; + +CREATE FUNCTION core.get_switch_category_id_by_name(text) +RETURNS integer +AS +$$ +BEGIN + RETURN + ( + SELECT switch_category_id + FROM core.switch_categories + WHERE core.switch_categories.switch_category_name=$1 + ); +END +$$ +LANGUAGE plpgsql; + +CREATE TABLE office.work_centers +( + work_center_id SERIAL NOT NULL PRIMARY KEY, + office_id integer NOT NULL REFERENCES office.offices(office_id), + work_center_code national character varying(12) NOT NULL, + work_center_name national character varying(128) NOT NULL, + audit_user_id integer NULL REFERENCES office.users(user_id), + audit_ts TIMESTAMP WITH TIME ZONE NULL DEFAULT(NOW()) +); + +CREATE UNIQUE INDEX work_centers_work_center_code_uix +ON office.work_centers(UPPER(work_center_code)); + +CREATE UNIQUE INDEX work_centers_work_center_name_uix +ON office.work_centers(UPPER(work_center_name)); + +CREATE VIEW office.work_center_view +AS +SELECT + office.work_centers.work_center_id, + office.offices.office_code || ' (' || office.offices.office_name || ')' AS office, + office.work_centers.work_center_code, + office.work_centers.work_center_name +FROM office.work_centers +INNER JOIN office.offices +ON office.work_centers.office_id = office.offices.office_id; + + + +CREATE FUNCTION office.is_admin(integer) +RETURNS boolean +AS +$$ +BEGIN + RETURN + ( + SELECT office.roles.is_admin FROM office.users + INNER JOIN office.roles + ON office.users.role_id = office.roles.role_id + WHERE office.users.user_id=$1 + ); +END +$$ +LANGUAGE PLPGSQL; + + +CREATE FUNCTION office.is_sys(integer) +RETURNS boolean +AS +$$ +BEGIN + RETURN + ( + SELECT office.roles.is_system FROM office.users + INNER JOIN office.roles + ON office.users.role_id = office.roles.role_id + WHERE office.users.user_id=$1 + ); +END +$$ +LANGUAGE PLPGSQL; + + + +CREATE TABLE policy.voucher_verification_policy +( + user_id integer NOT NULL PRIMARY KEY REFERENCES office.users(user_id), + can_verify_sales_transactions boolean NOT NULL CONSTRAINT voucher_verification_policy_verify_sales_df DEFAULT(false), + sales_verification_limit money NOT NULL CONSTRAINT voucher_verification_policy_sales_verification_limit_df DEFAULT(0), + can_verify_purchase_transactions boolean NOT NULL CONSTRAINT voucher_verification_policy_verify_purchase_df DEFAULT(false), + purchase_verification_limit money NOT NULL CONSTRAINT voucher_verification_policy_purchase_verification_limit_df DEFAULT(0), + can_verify_gl_transactions boolean NOT NULL CONSTRAINT voucher_verification_policy_verify_gl_df DEFAULT(false), + gl_verification_limit money NOT NULL CONSTRAINT voucher_verification_policy_gl_verification_limit_df DEFAULT(0), + can_self_verify boolean NOT NULL CONSTRAINT voucher_verification_policy_verify_self_df DEFAULT(false), + self_verification_limit money NOT NULL CONSTRAINT voucher_verification_policy_self_verification_limit_df DEFAULT(0), + effective_from date NOT NULL, + ends_on date NOT NULL, + is_active boolean NOT NULL, + audit_user_id integer NULL REFERENCES office.users(user_id), + audit_ts TIMESTAMP WITH TIME ZONE NULL DEFAULT(NOW()) +); + +CREATE VIEW policy.voucher_verification_policy_view +AS +SELECT + policy.voucher_verification_policy.user_id, + office.users.user_name, + policy.voucher_verification_policy.can_verify_sales_transactions, + policy.voucher_verification_policy.sales_verification_limit, + policy.voucher_verification_policy.can_verify_purchase_transactions, + policy.voucher_verification_policy.purchase_verification_limit, + policy.voucher_verification_policy.can_verify_gl_transactions, + policy.voucher_verification_policy.gl_verification_limit, + policy.voucher_verification_policy.can_self_verify, + policy.voucher_verification_policy.self_verification_limit, + policy.voucher_verification_policy.effective_from, + policy.voucher_verification_policy.ends_on, + policy.voucher_verification_policy.is_active +FROM policy.voucher_verification_policy +INNER JOIN office.users +ON policy.voucher_verification_policy.user_id=office.users.user_id; + +CREATE TABLE policy.auto_verification_policy +( + user_id integer NOT NULL PRIMARY KEY REFERENCES office.users(user_id), + verify_sales_transactions boolean NOT NULL CONSTRAINT auto_verification_policy_verify_sales_df DEFAULT(false), + sales_verification_limit money NOT NULL CONSTRAINT auto_verification_policy_sales_verification_limit_df DEFAULT(0), + verify_purchase_transactions boolean NOT NULL CONSTRAINT auto_verification_policy_verify_purchase_df DEFAULT(false), + purchase_verification_limit money NOT NULL CONSTRAINT auto_verification_policy_purchase_verification_limit_df DEFAULT(0), + verify_gl_transactions boolean NOT NULL CONSTRAINT auto_verification_policy_verify_gl_df DEFAULT(false), + gl_verification_limit money NOT NULL CONSTRAINT auto_verification_policy_gl_verification_limit_df DEFAULT(0), + effective_from date NOT NULL, + ends_on date NOT NULL, + is_active boolean NOT NULL, + audit_user_id integer NULL REFERENCES office.users(user_id), + audit_ts TIMESTAMP WITH TIME ZONE NULL DEFAULT(NOW()) +); + +CREATE VIEW policy.auto_verification_policy_view +AS +SELECT + policy.auto_verification_policy.user_id, + office.users.user_name, + policy.auto_verification_policy.verify_sales_transactions, + policy.auto_verification_policy.sales_verification_limit, + policy.auto_verification_policy.verify_purchase_transactions, + policy.auto_verification_policy.purchase_verification_limit, + policy.auto_verification_policy.verify_gl_transactions, + policy.auto_verification_policy.gl_verification_limit, + policy.auto_verification_policy.effective_from, + policy.auto_verification_policy.ends_on, + policy.auto_verification_policy.is_active +FROM policy.auto_verification_policy +INNER JOIN office.users +ON policy.auto_verification_policy.user_id=office.users.user_id; diff --git a/MixERP.Net.FrontEnd/db/en-US/mixerp.sql b/MixERP.Net.FrontEnd/db/en-US/mixerp.sql new file mode 100644 index 000000000..8824b3fbe --- /dev/null +++ b/MixERP.Net.FrontEnd/db/en-US/mixerp.sql @@ -0,0 +1,3588 @@ +/******************************************************************************** +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/. +***********************************************************************************/ + +/******************************************************************************** + NOTE: ALL RANDOM INDEXES ARE REMOVED FROM THE SCRIPT. + TODO LIST : NEED TO CREATE INDEXES. +***********************************************************************************/ + +DROP SCHEMA IF EXISTS audit CASCADE; +DROP SCHEMA IF EXISTS core CASCADE; +DROP SCHEMA IF EXISTS office CASCADE; +DROP SCHEMA IF EXISTS policy CASCADE; +DROP SCHEMA IF EXISTS transactions CASCADE; +DROP SCHEMA IF EXISTS crm CASCADE; +DROP SCHEMA IF EXISTS mrp CASCADE; + +CREATE SCHEMA audit; +CREATE SCHEMA core; +CREATE SCHEMA office; +CREATE SCHEMA policy; +CREATE SCHEMA transactions; +CREATE SCHEMA crm; +CREATE SCHEMA mrp; + + +CREATE TABLE core.verification_statuses +( + verification_status_id smallint NOT NULL PRIMARY KEY, + verification_status_name national character varying(128) NOT NULL +); + +CREATE UNIQUE INDEX verification_statuses_verification_status_name_uix +ON core.verification_statuses(UPPER(verification_status_name)); + + +--These are hardcoded values and therefore the meanings should always remain intact +--regardless of the language. +INSERT INTO core.verification_statuses +SELECT -3, 'Rejected' UNION ALL +SELECT -2, 'Closed' UNION ALL +SELECT -1, 'Withdrawn' UNION ALL +SELECT 0, 'Unverified' UNION ALL +SELECT 1, 'Automatically Approved by Workflow' UNION ALL +SELECT 2, 'Approved'; + +DROP DOMAIN IF EXISTS transaction_type; +CREATE DOMAIN transaction_type +AS char(2) +CHECK +( + VALUE IN + ( + 'Dr', --Debit + 'Cr' --Credit + ) +); + +/******************************************************************* + MIXERP STRICT Data Types: NEGATIVES ARE NOT ALLOWED +*******************************************************************/ + +DROP DOMAIN IF EXISTS money_strict; +CREATE DOMAIN money_strict +AS money +CHECK +( + VALUE > '0' +); + + +DROP DOMAIN IF EXISTS money_strict2; +CREATE DOMAIN money_strict2 +AS money +CHECK +( + VALUE >= '0' +); + +DROP DOMAIN IF EXISTS integer_strict; +CREATE DOMAIN integer_strict +AS integer +CHECK +( + VALUE > 0 +); + +DROP DOMAIN IF EXISTS integer_strict2; +CREATE DOMAIN integer_strict2 +AS integer +CHECK +( + VALUE >= 0 +); + +DROP DOMAIN IF EXISTS smallint_strict; +CREATE DOMAIN smallint_strict +AS smallint +CHECK +( + VALUE > 0 +); + +DROP DOMAIN IF EXISTS smallint_strict2; +CREATE DOMAIN smallint_strict2 +AS smallint +CHECK +( + VALUE >= 0 +); + +DROP DOMAIN IF EXISTS decimal_strict; +CREATE DOMAIN decimal_strict +AS decimal +CHECK +( + VALUE > 0 +); + +DROP VIEW IF EXISTS db_stat; +CREATE VIEW db_stat +AS +select + relname, + last_vacuum, + last_autovacuum, + last_analyze, + last_autoanalyze, + vacuum_count, + autovacuum_count, + analyze_count, + autoanalyze_count +from + pg_stat_user_tables; + +DROP DOMAIN IF EXISTS decimal_strict2; +CREATE DOMAIN decimal_strict2 +AS decimal +CHECK +( + VALUE >= 0 +); + +DROP DOMAIN IF EXISTS image_path; +CREATE DOMAIN image_path +AS text; + + + +CREATE TABLE office.users +( + user_id SERIAL NOT NULL PRIMARY KEY, + role_id smallint NOT NULL, + office_id integer NOT NULL, + user_name national character varying(50) NOT NULL, + full_name national character varying(100) NOT NULL, + password text NOT NULL, + audit_user_id integer NULL REFERENCES office.users(user_id), + audit_ts TIMESTAMP WITH TIME ZONE NULL DEFAULT(NOW()) +); + +CREATE TABLE core.currencies +( + currency_code national character varying(12) NOT NULL PRIMARY KEY, + currency_symbol national character varying(12) NOT NULL, + currency_name national character varying(48) NOT NULL UNIQUE, + hundredth_name national character varying(48) NOT NULL, + audit_user_id integer NULL REFERENCES office.users(user_id), + audit_ts TIMESTAMP WITH TIME ZONE NULL DEFAULT(NOW()) +); + +INSERT INTO core.currencies +SELECT 'NPR', 'Rs.', 'Nepali Rupees', 'paisa' UNION ALL +SELECT 'USD', '$ ', 'United States Dollar', 'cents'; + +CREATE FUNCTION office.is_parent_office(child integer_strict, parent integer_strict) +RETURNS boolean +AS +$$ +BEGIN + IF $1!=$2 THEN + IF EXISTS + ( + WITH RECURSIVE office_cte(office_id, path) AS ( + SELECT + tn.office_id, tn.office_id::TEXT AS path + FROM office.offices AS tn WHERE tn.parent_office_id IS NULL + UNION ALL + SELECT + c.office_id, (p.path || '->' || c.office_id::TEXT) + FROM office_cte AS p, office.offices AS c WHERE parent_office_id = p.office_id + ) + SELECT * FROM + ( + SELECT regexp_split_to_table(path, '->') + FROM office_cte AS n WHERE n.office_id = $2 + ) AS items + WHERE regexp_split_to_table=$1::text + ) THEN + RETURN TRUE; + END IF; + END IF; + RETURN false; +END +$$ +LANGUAGE plpgsql; + +CREATE TABLE office.offices +( + office_id SERIAL NOT NULL PRIMARY KEY, + office_code national character varying(12) NOT NULL, + office_name national character varying(150) NOT NULL, + nick_name national character varying(50) NULL, + registration_date date NOT NULL, + currency_code national character varying(12) NOT NULL + CONSTRAINT offices_currencies_fk REFERENCES core.currencies(currency_code) + CONSTRAINT offices_currency_code_df DEFAULT('NPR'), + address_line_1 national character varying(128) NULL, + address_line_2 national character varying(128) NULL, + street national character varying(50) NULL, + city national character varying(50) NULL, + state national character varying(50) NULL, + country national character varying(50) NULL, + zip_code national character varying(24) NULL, + phone national character varying(24) NULL, + fax national character varying(24) NULL, + email national character varying(128) NULL, + url national character varying(50) NULL, + registration_number national character varying(24) NULL, + pan_number national character varying(24) NULL, + audit_user_id integer NULL REFERENCES office.users(user_id), + audit_ts TIMESTAMP WITH TIME ZONE NULL DEFAULT(NOW()), + parent_office_id integer NULL REFERENCES office.offices(office_id) + CHECK + ( + office.is_parent_office(office_id, parent_office_id) = FALSE + AND + parent_office_id != office_id + ) +); + +ALTER TABLE office.users +ADD FOREIGN KEY(office_id) REFERENCES office.offices(office_id); + +CREATE UNIQUE INDEX offices_office_code_uix +ON office.offices(UPPER(office_code)); + +CREATE UNIQUE INDEX offices_office_name_uix +ON office.offices(UPPER(office_name)); + +CREATE UNIQUE INDEX offices_nick_name_uix +ON office.offices(UPPER(nick_name)); + + +/******************************************************************* + SAMPLE DATA FEED + TODO: REMOVE THE BELOW BEFORE RELEASE +*******************************************************************/ + +INSERT INTO office.offices(office_code,office_name,nick_name,registration_date, street,city,state,country,zip_code,phone,fax,email,url,registration_number,pan_number) +SELECT 'PES','Planet Earth Solutions', 'PES Technologies', '06/06/1989', 'Brooklyn','NY','','US','','','','info@planetearthsolution.com','http://planetearthsolution.com','0','0'; + + +INSERT INTO office.offices(office_code,office_name,nick_name, registration_date, street,city,state,country,zip_code,phone,fax,email,url,registration_number,pan_number,parent_office_id) +SELECT 'PES-NY-BK','Brooklyn Branch', 'PES Brooklyn', '06/06/1989', 'Brooklyn','NY','12345555','','','','','info@planetearthsolution.com','http://planetearthsolution.com','0','0',(SELECT office_id FROM office.offices WHERE office_code='PES'); + +INSERT INTO office.offices(office_code,office_name,nick_name, registration_date, street,city,state,country,zip_code,phone,fax,email,url,registration_number,pan_number,parent_office_id) +SELECT 'PES-NY-MEM','Memphis Branch', 'PES Memphis', '06/06/1989', 'Memphis', 'NY','','','','64464554','','info@planetearthsolution.com','http://planetearthsolution.com','0','0',(SELECT office_id FROM office.offices WHERE office_code='PES'); + + +/******************************************************************* + RETURNS MINI OFFICE TABLE +*******************************************************************/ + +CREATE TYPE office.office_type AS +( + office_id integer_strict, + office_code national character varying(12), + office_name national character varying(150), + address text +); + +CREATE FUNCTION office.get_offices() +RETURNS setof office.office_type +AS +$$ +DECLARE "@record" office.office_type%rowtype; +BEGIN + FOR "@record" IN SELECT office_id, office_code,office_name,street || ' ' || city AS Address FROM office.offices WHERE parent_office_id IS NOT NULL + LOOP + RETURN NEXT "@record"; + END LOOP; + + IF NOT FOUND THEN + FOR "@record" IN SELECT office_id, office_code,office_name,street || ' ' || city AS Address FROM office.offices WHERE parent_office_id IS NULL + LOOP + RETURN NEXT "@record"; + END LOOP; + END IF; + + RETURN; +END +$$ +LANGUAGE plpgsql; + + +CREATE FUNCTION office.get_office_name_by_id(office_id integer_strict) +RETURNS text +AS +$$ +BEGIN + RETURN + ( + SELECT office.offices.office_name FROM office.offices + WHERE office.offices.office_id=$1 + ); +END +$$ +LANGUAGE plpgsql; + + +--TODO +CREATE VIEW office.office_view +AS +SELECT * FROM office.offices; + +CREATE TABLE office.departments +( + department_id SERIAL NOT NULL PRIMARY KEY, + department_code national character varying(12) NOT NULL, + department_name national character varying(50) NOT NULL, + audit_user_id integer NULL REFERENCES office.users(user_id), + audit_ts TIMESTAMP WITH TIME ZONE NULL DEFAULT(NOW()) +); + + +CREATE UNIQUE INDEX departments_department_code_uix +ON office.departments(UPPER(department_code)); + +CREATE UNIQUE INDEX departments_department_name_uix +ON office.departments(UPPER(department_name)); + + +INSERT INTO office.departments(department_code, department_name) +SELECT 'SAL', 'Sales & Billing' UNION ALL +SELECT 'MKT', 'Marketing & Promotion' UNION ALL +SELECT 'SUP', 'Support' UNION ALL +SELECT 'CC', 'Customer Care'; + + +CREATE TABLE office.roles +( + role_id SERIAL NOT NULL PRIMARY KEY, + role_code national character varying(12) NOT NULL, + role_name national character varying(50) NOT NULL, + is_admin boolean NOT NULL CONSTRAINT roles_is_admin_df DEFAULT(false), + is_system boolean NOT NULL CONSTRAINT roles_is_system_df DEFAULT(false), + audit_user_id integer NULL REFERENCES office.users(user_id), + audit_ts TIMESTAMP WITH TIME ZONE NULL DEFAULT(NOW()) +); + +ALTER TABLE office.users +ADD FOREIGN KEY(role_id) REFERENCES office.roles(role_id); + + +CREATE UNIQUE INDEX roles_role_code_uix +ON office.roles(UPPER(role_code)); + +CREATE UNIQUE INDEX roles_role_name_uix +ON office.roles(UPPER(role_name)); + +INSERT INTO office.roles(role_code,role_name, is_system) +SELECT 'SYST', 'System', true; + +INSERT INTO office.roles(role_code,role_name, is_admin) +SELECT 'ADMN', 'Administrators', true; + +INSERT INTO office.roles(role_code,role_name) +SELECT 'USER', 'Users' UNION ALL +SELECT 'EXEC', 'Executive' UNION ALL +SELECT 'MNGR', 'Manager' UNION ALL +SELECT 'SALE', 'Sales' UNION ALL +SELECT 'MARK', 'Marketing' UNION ALL +SELECT 'LEGL', 'Legal & Compliance' UNION ALL +SELECT 'FINC', 'Finance' UNION ALL +SELECT 'HUMR', 'Human Resources' UNION ALL +SELECT 'INFO', 'Information Technology' UNION ALL +SELECT 'CUST', 'Customer Service'; + + + +CREATE FUNCTION office.get_office_id_by_user_id(user_id integer_strict) +RETURNS integer +AS +$$ +BEGIN + RETURN + ( + SELECT office.users.office_id FROM office.users + WHERE office.users.user_id=$1 + ); +END +$$ +LANGUAGE plpgsql; + +CREATE FUNCTION office.get_office_id_by_office_code(office_code text) +RETURNS integer +AS +$$ +BEGIN + RETURN + ( + SELECT office.offices.office_id FROM office.offices + WHERE office.offices.office_code=$1 + ); +END +$$ +LANGUAGE plpgsql; + +CREATE FUNCTION office.get_user_id_by_user_name(user_name text) +RETURNS integer +AS +$$ +BEGIN + RETURN + ( + SELECT office.users.user_id FROM office.users + WHERE office.users.user_name=$1 + ); +END +$$ +LANGUAGE plpgsql; + +CREATE FUNCTION office.get_user_name_by_user_id(user_id integer) +RETURNS text +AS +$$ +BEGIN + RETURN + ( + SELECT office.users.user_name FROM office.users + WHERE office.users.user_id=$1 + ); +END +$$ +LANGUAGE plpgsql; + +CREATE FUNCTION office.get_role_id_by_use_id(user_id integer_strict) +RETURNS integer +AS +$$ +BEGIN + RETURN + ( + SELECT office.users.role_id FROM office.users + WHERE office.users.user_id=$1 + ); +END +$$ +LANGUAGE plpgsql; + + +CREATE FUNCTION office.get_role_code_by_user_name(user_name text) +RETURNS text +AS +$$ +BEGIN + RETURN + ( + SELECT office.roles.role_code FROM office.roles, office.users + WHERE office.roles.role_id=office.users.role_id + AND office.users.user_name=$1 + ); +END +$$ +LANGUAGE plpgsql; + +CREATE VIEW office.user_view +AS +SELECT + office.users.user_id, + office.users.user_name, + office.users.full_name, + office.roles.role_name, + office.offices.office_name +FROM + office.users +INNER JOIN office.roles +ON office.users.role_id = office.roles.role_id +INNER JOIN office.offices +ON office.users.office_id = office.offices.office_id; + +CREATE FUNCTION office.get_sys_user_id() +RETURNS integer +AS +$$ +BEGIN + RETURN + ( + SELECT office.users.user_id + FROM office.roles, office.users + WHERE office.roles.role_id = office.users.role_id + AND office.roles.is_system=true LIMIT 1 + ); +END +$$ +LANGUAGE plpgsql; + + + +CREATE FUNCTION office.create_user +( + role_id integer_strict, + office_id integer_strict, + user_name text, + password text, + full_name text +) +RETURNS VOID +AS +$$ +BEGIN + INSERT INTO office.users(role_id,office_id,user_name,password, full_name) + SELECT $1, $2, $3, $4,$5; + RETURN; +END +$$ +LANGUAGE plpgsql; + + +SELECT office.create_user((SELECT role_id FROM office.roles WHERE role_code='SYST'),(SELECT office_id FROM office.offices WHERE office_code='PES'),'sys','','System'); + +/******************************************************************* + TODO: REMOVE THIS USER ON DEPLOYMENT +*******************************************************************/ +SELECT office.create_user((SELECT role_id FROM office.roles WHERE role_code='ADMN'),(SELECT office_id FROM office.offices WHERE office_code='PES'),'binod','+qJ9AMyGgrX/AOF4GmwmBa4SrA3+InlErVkJYmAopVZh+WFJD7k2ZO9dxox6XiqT38dSoM72jLoXNzwvY7JAQA==','Binod Nepal'); + +CREATE FUNCTION office.validate_login +( + user_name text, + password text +) +RETURNS boolean +AS +$$ +BEGIN + IF EXISTS + ( + SELECT 1 FROM office.users + WHERE office.users.user_name=$1 + AND office.users.password=$2 + --The system user should not be allowed to login. + AND office.users.role_id != + ( + SELECT office.roles.role_id + FROM office.roles + WHERE office.roles.role_code='SYST' + ) + ) THEN + RETURN true; + END IF; + RETURN false; +END +$$ +LANGUAGE plpgsql; + + + +CREATE UNIQUE INDEX users_user_name_uix +ON office.users(UPPER(user_name)); + + +CREATE TABLE audit.logins +( + login_id BIGSERIAL NOT NULL PRIMARY KEY, + user_id integer NOT NULL REFERENCES office.users(user_id), + office_id integer NOT NULL REFERENCES office.offices(office_id), + browser national character varying(500) NOT NULL, + ip_address national character varying(50) NOT NULL, + login_date_time TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT(now()), + remote_user national character varying(50) NOT NULL +); + +CREATE FUNCTION office.get_login_id(_user_id integer) +RETURNS bigint +AS +$$ +BEGIN + RETURN + ( + SELECT login_id + FROM audit.logins + WHERE user_id=$1 + AND login_date_time = + ( + SELECT MAX(login_date_time) + FROM audit.logins + WHERE user_id=$1 + ) + ); +END +$$ +LANGUAGE plpgsql; + +CREATE FUNCTION office.get_logged_in_office_id(_user_id integer) +RETURNS integer +AS +$$ +BEGIN + RETURN + ( + SELECT office_id + FROM audit.logins + WHERE user_id=$1 + AND login_date_time = + ( + SELECT MAX(login_date_time) + FROM audit.logins + WHERE user_id=$1 + ) + ); +END +$$ +LANGUAGE plpgsql; + +CREATE TABLE audit.failed_logins +( + failed_login_id BIGSERIAL NOT NULL PRIMARY KEY, + user_id integer NULL REFERENCES office.users(user_id), + user_name national character varying(50) NOT NULL, + office_id integer NOT NULL REFERENCES office.offices(office_id), + browser national character varying(500) NOT NULL, + ip_address national character varying(50) NOT NULL, + failed_date_time TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT(now()), + remote_user national character varying(50) NOT NULL, + details national character varying(250) NULL +); + + +CREATE TABLE policy.lock_outs +( + lock_out_id BIGSERIAL NOT NULL PRIMARY KEY, + user_id integer NOT NULL REFERENCES office.users(user_id), + lock_out_time TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT(NOW()), + lock_out_till TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT(NOW() + '5 minutes'::interval) +); + +--TODO: Create a lockout policy. +CREATE FUNCTION policy.perform_lock_out() +RETURNS TRIGGER +AS +$$ +BEGIN + IF( + SELECT COUNT(*) FROM audit.failed_logins + WHERE audit.failed_logins.user_id=NEW.user_id + AND audit.failed_logins.failed_date_time + BETWEEN NOW()-'5minutes'::interval + AND NOW() + )::integer>5 THEN + + INSERT INTO policy.lock_outs(user_id)SELECT NEW.user_id; +END IF; +RETURN NEW; +END +$$ +LANGUAGE plpgsql; + +CREATE TRIGGER lockout_user +AFTER INSERT +ON audit.failed_logins +FOR EACH ROW EXECUTE PROCEDURE policy.perform_lock_out(); + +CREATE FUNCTION policy.is_locked_out_till(user_id integer_strict) +RETURNS TIMESTAMP +AS +$$ +BEGIN + RETURN + ( + SELECT MAX(policy.lock_outs.lock_out_till)::TIMESTAMP WITHOUT TIME ZONE FROM policy.lock_outs + WHERE policy.lock_outs.user_id=$1 + ); +END +$$ +LANGUAGE plpgsql; + + + +CREATE TABLE core.price_types +( + price_type_id SERIAL NOT NULL PRIMARY KEY, + price_type_code national character varying(12) NOT NULL, + price_type_name national character varying(50) NOT NULL, + audit_user_id integer NULL REFERENCES office.users(user_id), + audit_ts TIMESTAMP WITH TIME ZONE NULL DEFAULT(NOW()) +); + + +CREATE UNIQUE INDEX price_types_price_type_code_uix +ON core.price_types(UPPER(price_type_code)); + +CREATE UNIQUE INDEX price_types_price_type_name_uix +ON core.price_types(UPPER(price_type_name)); + + +INSERT INTO core.price_types(price_type_code, price_type_name) +SELECT 'RET', 'Retail' UNION ALL +SELECT 'WHO', 'Wholesale'; + + + +CREATE TABLE core.menus +( + menu_id SERIAL NOT NULL PRIMARY KEY, + menu_text national character varying(250) NOT NULL, + url national character varying(250) NULL, + menu_code national character varying(12) NOT NULL, + level smallint NOT NULL, + parent_menu_id integer NULL REFERENCES core.menus(menu_id), + audit_user_id integer NULL REFERENCES office.users(user_id), + audit_ts TIMESTAMP WITH TIME ZONE NULL DEFAULT(NOW()) +); + +CREATE UNIQUE INDEX menus_menu_code_uix +ON core.menus(UPPER(menu_code)); + +CREATE FUNCTION core.get_menu_id(menu_code text) +RETURNS INTEGER +AS +$$ +BEGIN + RETURN + ( + SELECT core.menus.menu_id + FROM core.menus + WHERE core.menus.menu_code=$1 + ); +END +$$ +LANGUAGE plpgsql; + + + +CREATE FUNCTION core.get_root_parent_menu_id(text) +RETURNS integer +AS +$$ + DECLARE retVal integer; +BEGIN + WITH RECURSIVE find_parent(menu_id_group, parent, parent_menu_id, recentness) AS + ( + SELECT menu_id, menu_id, parent_menu_id, 0 + FROM core.menus + WHERE url=$1 + UNION ALL + SELECT fp.menu_id_group, i.menu_id, i.parent_menu_id, fp.recentness + 1 + FROM core.menus i + JOIN find_parent fp ON i.menu_id = fp.parent_menu_id + ) + + SELECT parent INTO retVal + FROM find_parent q + JOIN + ( + SELECT menu_id_group, MAX(recentness) AS answer + FROM find_parent + GROUP BY menu_id_group + ) AS ans ON q.menu_id_group = ans.menu_id_group AND q.recentness = ans.answer + ORDER BY q.menu_id_group; + + RETURN retVal; +END +$$ +LANGUAGE plpgsql; + + +INSERT INTO core.menus(menu_text, url, menu_code, level) +SELECT 'Dashboard', '/Dashboard/Index.aspx', 'DB', 0 UNION ALL +SELECT 'Sales', '/Sales/Index.aspx', 'SA', 0 UNION ALL +SELECT 'Purchase', '/Purchase/Index.aspx', 'PU', 0 UNION ALL +SELECT 'Products & Items', '/Items/Index.aspx', 'ITM', 0 UNION ALL +SELECT 'Finance', '/Finance/Index.aspx', 'FI', 0 UNION ALL +SELECT 'Manufacturing', '/Manufacturing/Index.aspx', 'MF', 0 UNION ALL +SELECT 'CRM', '/CRM/Index.aspx', 'CRM', 0 UNION ALL +SELECT 'Setup Parameters', '/Setup/Index.aspx', 'SE', 0 UNION ALL +SELECT 'POS', '/POS/Index.aspx', 'POS', 0; + + +INSERT INTO core.menus(menu_text, url, menu_code, level, parent_menu_id) + SELECT 'Sales & Quotation', NULL, 'SAQ', 1, core.get_menu_id('SA') +UNION ALL SELECT 'Direct Sales', '/Sales/DirectSales.aspx', 'DRS', 2, core.get_menu_id('SAQ') +UNION ALL SELECT 'Sales Quotation', '/Sales/Quotation.aspx', 'SQ', 2, core.get_menu_id('SAQ') +UNION ALL SELECT 'Sales Order', '/Sales/Order.aspx', 'SO', 2, core.get_menu_id('SAQ') +UNION ALL SELECT 'Delivery for Sales Order', '/Sales/DeliveryForOrder.aspx', 'DSO', 2, core.get_menu_id('SAQ') +UNION ALL SELECT 'Delivery Without Sales Order', '/Sales/DeliveryWithoutOrder.aspx', 'DWO', 2, core.get_menu_id('SAQ') +UNION ALL SELECT 'Invoice for Sales Delivery', '/Sales/Invoice.aspx', 'ISD', 2, core.get_menu_id('SAQ') +UNION ALL SELECT 'Receipt from Customer', '/Sales/Receipt.aspx', 'RFC', 2, core.get_menu_id('SAQ') +UNION ALL SELECT 'Sales Return', '/Sales/Return.aspx', 'SR', 2, core.get_menu_id('SAQ') +UNION ALL SELECT 'Setup & Maintenance', NULL, 'SSM', 1, core.get_menu_id('SA') +UNION ALL SELECT 'Bonus Slab for Agents', '/Sales/Setup/AgentBonusSlabs.aspx', 'ABS', 2, core.get_menu_id('SSM') +UNION ALL SELECT 'Bonus Slab Details', '/Sales/Setup/AgentBonusSlabDetails.aspx', 'BSD', 2, core.get_menu_id('SSM') +UNION ALL SELECT 'Sales Agents', '/Sales/Setup/Agents.aspx', 'SSA', 2, core.get_menu_id('SSM') +UNION ALL SELECT 'Bonus Slab Assignment', '/Sales/Setup/BonusSlabAssignment.aspx', 'BSA', 2, core.get_menu_id('SSM') +UNION ALL SELECT 'Sales Reports', NULL, 'SAR', 1, core.get_menu_id('SA') +UNION ALL SELECT 'View Sales Inovice', '/Reports/Sales.View.Sales.Invoice.xml', 'SAR-SVSI', 2, core.get_menu_id('SAR') +UNION ALL SELECT 'Cashier Management', NULL, 'CM', 1, core.get_menu_id('POS') +UNION ALL SELECT 'Assign Cashier', '/POS/AssignCashier.aspx', 'ASC', 2, core.get_menu_id('CM') +UNION ALL SELECT 'POS Setup', NULL, 'POSS', 1, core.get_menu_id('POS') +UNION ALL SELECT 'Store Types', '/POS/Setup/StoreTypes.aspx', 'STT', 2, core.get_menu_id('POSS') +UNION ALL SELECT 'Stores', '/POS/Setup/Stores.aspx', 'STO', 2, core.get_menu_id('POSS') +UNION ALL SELECT 'Cash Repository Setup', '/Setup/CashRepositories.aspx', 'SCR', 2, core.get_menu_id('POSS') +UNION ALL SELECT 'Counter Setup', '/Setup/Counters.aspx', 'SCS', 2, core.get_menu_id('POSS') +UNION ALL SELECT 'Purchase & Quotation', NULL, 'PUQ', 1, core.get_menu_id('PU') +UNION ALL SELECT 'Direct Purchase', '/Purchase/DirectPurchase.aspx', 'DRP', 2, core.get_menu_id('PUQ') +UNION ALL SELECT 'Purchase Order', '/Purchase/Order.aspx', 'PO', 2, core.get_menu_id('PUQ') +UNION ALL SELECT 'GRN against PO', '/Purchase/GRN.aspx', 'GRN', 2, core.get_menu_id('PUQ') +UNION ALL SELECT 'Purchase Invoice Against GRN', '/Purchase/Invoice.aspx', 'PAY', 2, core.get_menu_id('PUQ') +UNION ALL SELECT 'Payment to Supplier', '/Purchase/Payment.aspx', 'PAS', 2, core.get_menu_id('PUQ') +UNION ALL SELECT 'Purchase Return', '/Purchase/Return.aspx', 'PR', 2, core.get_menu_id('PUQ') +UNION ALL SELECT 'Purchase Reports', NULL, 'PUR', 1, core.get_menu_id('PU') +UNION ALL SELECT 'Inventory Movements', NULL, 'IIM', 1, core.get_menu_id('ITM') +UNION ALL SELECT 'Stock Transfer Journal', '/Items/Transfer.aspx', 'STJ', 2, core.get_menu_id('IIM') +UNION ALL SELECT 'Stock Adjustments', '/Items/Adjustment.aspx', 'STA', 2, core.get_menu_id('IIM') +UNION ALL SELECT 'Setup & Maintenance', NULL, 'ISM', 1, core.get_menu_id('ITM') +UNION ALL SELECT 'Party Types', '/Items/Setup/PartyTypes.aspx', 'PT', 2, core.get_menu_id('ISM') +UNION ALL SELECT 'Party Accounts', '/Items/Setup/Parties.aspx', 'PA', 2, core.get_menu_id('ISM') +UNION ALL SELECT 'Shipping Addresses', '/Items/Setup/ShippingAddresses.aspx', 'PSA', 2, core.get_menu_id('ISM') +UNION ALL SELECT 'Item Maintenance', '/Items/Setup/Items.aspx', 'SSI', 2, core.get_menu_id('ISM') +UNION ALL SELECT 'Cost Prices', '/Items/Setup/CostPrices.aspx', 'ICP', 2, core.get_menu_id('ISM') +UNION ALL SELECT 'Selling Prices', '/Items/Setup/SellingPrices.aspx', 'ISP', 2, core.get_menu_id('ISM') +UNION ALL SELECT 'Item Groups', '/Items/Setup/ItemGroups.aspx', 'SSG', 2, core.get_menu_id('ISM') +UNION ALL SELECT 'Brands', '/Items/Setup/Brands.aspx', 'SSB', 2, core.get_menu_id('ISM') +UNION ALL SELECT 'Units of Measure', '/Items/Setup/UOM.aspx', 'UOM', 2, core.get_menu_id('ISM') +UNION ALL SELECT 'Compound Units of Measure', '/Items/Setup/CUOM.aspx', 'CUOM', 2, core.get_menu_id('ISM') +UNION ALL SELECT 'Shipper Information', '/Items/Setup/Shipper.aspx', 'SHI', 2, core.get_menu_id('ISM') +UNION ALL SELECT 'Transactions & Templates', NULL, 'FTT', 1, core.get_menu_id('FI') +UNION ALL SELECT 'Journal Voucher Entry', '/Finance/JournalVoucher.aspx', 'JVN', 2, core.get_menu_id('FTT') +UNION ALL SELECT 'Template Transaction', '/Finance/TemplateTransaction.aspx', 'TTR', 2, core.get_menu_id('FTT') +UNION ALL SELECT 'Standing Instructions', '/Finance/StandingInstructions.aspx', 'STN', 2, core.get_menu_id('FTT') +UNION ALL SELECT 'Update Exchange Rates', '/Finance/UpdateExchangeRates.aspx', 'UER', 2, core.get_menu_id('FTT') +UNION ALL SELECT 'Reconcile Bank Account', '/Finance/BankReconcilation.aspx', 'RBA', 2, core.get_menu_id('FTT') +UNION ALL SELECT 'Voucher Verification', '/Finance/VoucherVerification.aspx', 'FVV', 2, core.get_menu_id('FTT') +UNION ALL SELECT 'Transaction Document Manager', '/Finance/TransactionDocumentManager.aspx', 'FTDM', 2, core.get_menu_id('FTT') +UNION ALL SELECT 'Setup & Maintenance', NULL, 'FSM', 1, core.get_menu_id('FI') +UNION ALL SELECT 'Chart of Accounts', '/Finance/Setup/COA.aspx', 'COA', 2, core.get_menu_id('FSM') +UNION ALL SELECT 'Currency Management', '/Finance/Setup/Currencies.aspx', 'CUR', 2, core.get_menu_id('FSM') +UNION ALL SELECT 'Bank Accounts', '/Finance/Setup/BankAccounts.aspx', 'CBA', 2, core.get_menu_id('FSM') +UNION ALL SELECT 'Product GL Mapping', '/Finance/Setup/ProductGLMapping.aspx', 'PGM', 2, core.get_menu_id('FSM') +UNION ALL SELECT 'Budgets & Targets', '/Finance/Setup/BudgetAndTarget.aspx', 'BT', 2, core.get_menu_id('FSM') +UNION ALL SELECT 'Ageing Slabs', '/Finance/Setup/AgeingSlabs.aspx', 'AGS', 2, core.get_menu_id('FSM') +UNION ALL SELECT 'Tax Types', '/Finance/Setup/TaxTypes.aspx', 'TTY', 2, core.get_menu_id('FSM') +UNION ALL SELECT 'Tax Setup', '/Finance/Setup/TaxSetup.aspx', 'TS', 2, core.get_menu_id('FSM') +UNION ALL SELECT 'Cost Centers', '/Finance/Setup/CostCenters.aspx', 'CC', 2, core.get_menu_id('FSM') +UNION ALL SELECT 'Manufacturing Workflow', NULL, 'MFW', 1, core.get_menu_id('MF') +UNION ALL SELECT 'Sales Forecast', '/Manufacturing/Workflow/SalesForecast.aspx', 'MFWSF', 2, core.get_menu_id('MFW') +UNION ALL SELECT 'Master Production Schedule', '/Manufacturing/Workflow/MasterProductionSchedule.aspx', 'MFWMPS', 2, core.get_menu_id('MFW') +UNION ALL SELECT 'Manufacturing Setup', NULL, 'MFS', 1, core.get_menu_id('MF') +UNION ALL SELECT 'Work Centers', '/Manufacturing/Setup/WorkCenters.aspx', 'MFSWC', 2, core.get_menu_id('MFS') +UNION ALL SELECT 'Bills of Material', '/Manufacturing/Setup/BillsOfMaterial.aspx', 'MFSBOM', 2, core.get_menu_id('MFS') +UNION ALL SELECT 'Manufacturing Reports', NULL, 'MFR', 1, core.get_menu_id('MF') +UNION ALL SELECT 'Gross & Net Requirements', '/Manufacturing/Reports/GrossAndNetRequirements.aspx', 'MFRGNR', 2, core.get_menu_id('MFR') +UNION ALL SELECT 'Capacity vs Lead', '/Manufacturing/Reports/CapacityVersusLead.aspx', 'MFRCVSL', 2, core.get_menu_id('MFR') +UNION ALL SELECT 'Shop Floor Planning', '/Manufacturing/Reports/ShopFloorPlanning.aspx', 'MFRSFP', 2, core.get_menu_id('MFR') +UNION ALL SELECT 'Production Order Status', '/Manufacturing/Reports/ProductionOrderStatus.aspx', 'MFRPOS', 2, core.get_menu_id('MFR') +UNION ALL SELECT 'CRM Main', NULL, 'CRMM', 1, core.get_menu_id('CRM') +UNION ALL SELECT 'Add a New Lead', '/CRM/Lead.aspx', 'CRML', 2, core.get_menu_id('CRMM') +UNION ALL SELECT 'Add a New Opportunity', '/CRM/Opportunity.aspx', 'CRMO', 2, core.get_menu_id('CRMM') +UNION ALL SELECT 'Convert Lead to Opportunity', '/CRM/ConvertLeadToOpportunity.aspx', 'CRMC', 2, core.get_menu_id('CRMM') +UNION ALL SELECT 'Lead Followup', '/CRM/LeadFollowup.aspx', 'CRMFL', 2, core.get_menu_id('CRMM') +UNION ALL SELECT 'Opportunity Followup', '/CRM/OpportunityFollowup.aspx', 'CRMFO', 2, core.get_menu_id('CRMM') +UNION ALL SELECT 'Setup & Maintenance', NULL, 'CSM', 1, core.get_menu_id('CRM') +UNION ALL SELECT 'Lead Sources Setup', '/CRM/Setup/LeadSources.aspx', 'CRMLS', 2, core.get_menu_id('CSM') +UNION ALL SELECT 'Lead Status Setup', '/CRM/Setup/LeadStatuses.aspx', 'CRMLST', 2, core.get_menu_id('CSM') +UNION ALL SELECT 'Opportunity Stages Setup', '/CRM/Setup/OpportunityStages.aspx', 'CRMOS', 2, core.get_menu_id('CSM') +UNION ALL SELECT 'Office Setup', NULL, 'SOS', 1, core.get_menu_id('SE') +UNION ALL SELECT 'Office & Branch Setup', '/Setup/Offices.aspx', 'SOB', 2, core.get_menu_id('SOS') +UNION ALL SELECT 'Department Setup', '/Setup/Departments.aspx', 'SDS', 2, core.get_menu_id('SOS') +UNION ALL SELECT 'Role Management', '/Setup/Roles.aspx', 'SRM', 2, core.get_menu_id('SOS') +UNION ALL SELECT 'User Management', '/Setup/Users.aspx', 'SUM', 2, core.get_menu_id('SOS') +UNION ALL SELECT 'Fiscal Year Information', '/Setup/FiscalYear.aspx', 'SFY', 2, core.get_menu_id('SOS') +UNION ALL SELECT 'Frequency & Fiscal Year Management', '/Setup/Frequency.aspx', 'SFR', 2, core.get_menu_id('SOS') +UNION ALL SELECT 'Policy Management', NULL, 'SPM', 1, core.get_menu_id('SE') +UNION ALL SELECT 'Voucher Verification Policy', '/Setup/Policy/VoucherVerification.aspx', 'SVV', 2, core.get_menu_id('SPM') +UNION ALL SELECT 'Automatic Verification Policy', '/Setup/Policy/AutoVerification.aspx', 'SAV', 2, core.get_menu_id('SPM') +UNION ALL SELECT 'Menu Access Policy', '/Setup/Policy/MenuAccess.aspx', 'SMA', 2, core.get_menu_id('SPM') +UNION ALL SELECT 'GL Access Policy', '/Setup/Policy/GLAccess.aspx', 'SAP', 2, core.get_menu_id('SPM') +UNION ALL SELECT 'Store Policy', '/Setup/Policy/Store.aspx', 'SSP', 2, core.get_menu_id('SPM') +UNION ALL SELECT 'Switches', '/Setup/Policy/Switches.aspx', 'SWI', 2, core.get_menu_id('SPM') +UNION ALL SELECT 'Admin Tools', NULL, 'SAT', 1, core.get_menu_id('SE') +UNION ALL SELECT 'SQL Query Tool', '/Setup/Admin/Query.aspx', 'SQL', 2, core.get_menu_id('SAT') +UNION ALL SELECT 'Database Statistics', '/Setup/Admin/DatabaseStatistics.aspx', 'DBSTAT', 2, core.get_menu_id('SAT') +UNION ALL SELECT 'Backup Database', '/Setup/Admin/Backup.aspx', 'BAK', 2, core.get_menu_id('SAT') +UNION ALL SELECT 'Restore Database', '/Setup/Admin/Restore.aspx', 'RES', 2, core.get_menu_id('SAT') +UNION ALL SELECT 'Change User Password', '/Setup/Admin/ChangePassword.aspx', 'PWD', 2, core.get_menu_id('SAT') +UNION ALL SELECT 'New Company', '/Setup/Admin/NewCompany.aspx', 'NEW', 2, core.get_menu_id('SAT'); + + + +CREATE VIEW office.login_view +AS +SELECT + users.user_id, + roles.role_code || ' (' || roles.role_name || ')' AS role, + roles.is_admin, + roles.is_system, + users.user_name, + users.full_name, + office.get_login_id(office.users.user_id) AS login_id, + office.get_logged_in_office_id(office.users.user_id) AS office_id, + logged_in_office.office_code || ' (' || logged_in_office.office_name || ')' AS office, + logged_in_office.office_code, + logged_in_office.office_name, + logged_in_office.nick_name, + logged_in_office.registration_date, + logged_in_office.registration_number, + logged_in_office.pan_number, + logged_in_office.address_line_1, + logged_in_office.address_line_2, + logged_in_office.street, + logged_in_office.city, + logged_in_office.state, + logged_in_office.country, + logged_in_office.zip_code, + logged_in_office.phone, + logged_in_office.fax, + logged_in_office.email, + logged_in_office.url +FROM + office.users +INNER JOIN + office.roles +ON + users.role_id = roles.role_id +INNER JOIN + office.offices +ON + users.office_id = offices.office_id +LEFT JOIN + office.offices AS logged_in_office +ON + logged_in_office.office_id = office.get_logged_in_office_id(office.users.user_id); + + +CREATE OR REPLACE VIEW office.role_view +AS +SELECT + roles.role_id, + roles.role_code, + roles.role_name +FROM + office.roles; + + +CREATE VIEW core.relationship_view +AS +SELECT + tc.table_schema, + tc.table_name, + kcu.column_name, + ccu.table_schema AS references_schema, + ccu.table_name AS references_table, + ccu.column_name AS references_field +FROM + information_schema.table_constraints tc +LEFT JOIN + information_schema.key_column_usage kcu + ON tc.constraint_catalog = kcu.constraint_catalog + AND tc.constraint_schema = kcu.constraint_schema + AND tc.constraint_name = kcu.constraint_name +LEFT JOIN + information_schema.referential_constraints rc + ON tc.constraint_catalog = rc.constraint_catalog + AND tc.constraint_schema = rc.constraint_schema + AND tc.constraint_name = rc.constraint_name +LEFT JOIN + information_schema.constraint_column_usage ccu + ON rc.unique_constraint_catalog = ccu.constraint_catalog + AND rc.unique_constraint_schema = ccu.constraint_schema + AND rc.unique_constraint_name = ccu.constraint_name +WHERE + lower(tc.constraint_type) in ('foreign key'); + + +CREATE FUNCTION core.parse_default(text) +RETURNS text +AS +$$ +DECLARE _sql text; +DECLARE _val text; +BEGIN + IF($1 LIKE '%::%' AND $1 NOT LIKE 'nextval%') THEN + _sql := 'SELECT ' || $1; + EXECUTE _sql INTO _val; + RETURN _val; + END IF; + + RETURN $1; +END +$$ +LANGUAGE plpgsql; + +CREATE VIEW core.mixerp_table_view +AS +SELECT information_schema.columns.table_schema, + information_schema.columns.table_name, + information_schema.columns.column_name, + references_schema, + references_table, + references_field, + ordinal_position, + is_nullable, + core.parse_default(column_default) AS column_default, + data_type, + domain_name, + character_maximum_length, + character_octet_length, + numeric_precision, + numeric_precision_radix, + numeric_scale, + datetime_precision, + udt_name +FROM information_schema.columns + LEFT JOIN core.relationship_view + ON information_schema.columns.table_schema = + core.relationship_view.table_schema + AND information_schema.columns.table_name = + core.relationship_view.table_name + AND information_schema.columns.column_name = + core.relationship_view.column_name +WHERE information_schema.columns.table_schema +NOT IN + ( + 'pg_catalog', 'information_schema' + ) +AND information_schema.columns.column_name +NOT IN + ( + 'audit_user_id', 'audit_ts' + ) +; + + +CREATE TABLE core.frequencies +( + frequency_id SERIAL NOT NULL PRIMARY KEY, + frequency_code national character varying(12) NOT NULL, + frequency_name national character varying(50) NOT NULL +); + + +CREATE UNIQUE INDEX frequencies_frequency_code_uix +ON core.frequencies(UPPER(frequency_code)); + +CREATE UNIQUE INDEX frequencies_frequency_name_uix +ON core.frequencies(UPPER(frequency_name)); + +INSERT INTO core.frequencies +SELECT 2, 'EOM', 'End of Month' UNION ALL +SELECT 3, 'EOQ', 'End of Quarter' UNION ALL +SELECT 4, 'EOH', 'End of Half' UNION ALL +SELECT 5, 'EOY', 'End of Year'; + + +CREATE TABLE core.fiscal_year +( + fiscal_year_code national character varying(12) NOT NULL PRIMARY KEY, + fiscal_year_name national character varying(50) NOT NULL, + starts_from date NOT NULL, + ends_on date NOT NULL, + audit_user_id integer NULL REFERENCES office.users(user_id), + audit_ts TIMESTAMP WITH TIME ZONE NULL DEFAULT(NOW()) +); + +CREATE UNIQUE INDEX fiscal_year_fiscal_year_name_uix +ON core.fiscal_year(UPPER(fiscal_year_name)); + +CREATE UNIQUE INDEX fiscal_year_starts_from_uix +ON core.fiscal_year(starts_from); + +CREATE UNIQUE INDEX fiscal_year_ends_on_uix +ON core.fiscal_year(ends_on); + + +CREATE TABLE core.frequency_setups +( + frequency_setup_id SERIAL NOT NULL PRIMARY KEY, + fiscal_year_code national character varying(12) NOT NULL REFERENCES core.fiscal_year(fiscal_year_code), + value_date date NOT NULL UNIQUE, + frequency_id integer NOT NULL REFERENCES core.frequencies(frequency_id), + audit_user_id integer NULL REFERENCES office.users(user_id), + audit_ts TIMESTAMP WITH TIME ZONE NULL DEFAULT(NOW()) +); + +--TODO: Validation constraints for core.frequency_setups + +CREATE TABLE core.units +( + unit_id SERIAL NOT NULL PRIMARY KEY, + unit_code national character varying(12) NOT NULL, + unit_name national character varying(50) NOT NULL, + audit_user_id integer NULL REFERENCES office.users(user_id), + audit_ts TIMESTAMP WITH TIME ZONE NULL DEFAULT(NOW()) +); + +CREATE UNIQUE INDEX units_unit_code_uix +ON core.units(UPPER(unit_code)); + +CREATE UNIQUE INDEX "units_unit_name_uix" +ON core.units(UPPER(unit_name)); + +INSERT INTO core.units(unit_code, unit_name) +SELECT 'PC', 'Piece' UNION ALL +SELECT 'FT', 'Feet' UNION ALL +SELECT 'MTR', 'Meter' UNION ALL +SELECT 'LTR', 'Liter' UNION ALL +SELECT 'GM', 'Gram' UNION ALL +SELECT 'KG', 'Kilogram' UNION ALL +SELECT 'DZ', 'Dozen' UNION ALL +SELECT 'BX', 'Box'; + +CREATE FUNCTION core.get_unit_id_by_unit_code(text) +RETURNS smallint +AS +$$ +BEGIN + RETURN + ( + SELECT + core.units.unit_id + FROM + core.units + WHERE + core.units.unit_code=$1 + ); +END +$$ +LANGUAGE plpgsql; + +CREATE FUNCTION core.get_unit_id_by_unit_name(text) +RETURNS integer +AS +$$ +BEGIN + RETURN + ( + SELECT + core.units.unit_id + FROM + core.units + WHERE + core.units.unit_name=$1 + ); +END +$$ +LANGUAGE plpgsql; + +CREATE TABLE core.compound_units +( + compound_unit_id SERIAL NOT NULL PRIMARY KEY, + base_unit_id integer NOT NULL REFERENCES core.units(unit_id), + value smallint NOT NULL, + compare_unit_id integer NOT NULL REFERENCES core.units(unit_id), + audit_user_id integer NULL REFERENCES office.users(user_id), + audit_ts TIMESTAMP WITH TIME ZONE NULL DEFAULT(NOW()), + CONSTRAINT compound_units_check CHECK(base_unit_id != compare_unit_id) +); + +CREATE UNIQUE INDEX compound_units_info_uix +ON core.compound_units(base_unit_id, compare_unit_id); + +INSERT INTO core.compound_units(base_unit_id, compare_unit_id, value) +SELECT core.get_unit_id_by_unit_code('PC'), core.get_unit_id_by_unit_code('DZ'), 12 UNION ALL +SELECT core.get_unit_id_by_unit_code('DZ'), core.get_unit_id_by_unit_code('BX'), 100 UNION ALL +SELECT core.get_unit_id_by_unit_code('GM'), core.get_unit_id_by_unit_code('KG'), 1000; + +CREATE FUNCTION core.get_root_unit_id(integer) +RETURNS integer +AS +$$ + DECLARE root_unit_id integer; +BEGIN + SELECT base_unit_id INTO root_unit_id + FROM core.compound_units + WHERE compare_unit_id=$1; + + IF(root_unit_id IS NULL) THEN + RETURN $1; + ELSE + RETURN core.get_root_unit_id(root_unit_id); + END IF; +END +$$ +LANGUAGE plpgsql; + +CREATE FUNCTION core.is_parent_unit(parent integer, child integer) +RETURNS boolean +AS +$$ +BEGIN + IF $1!=$2 THEN + IF EXISTS + ( + WITH RECURSIVE unit_cte(unit_id) AS + ( + SELECT tn.compare_unit_id + FROM core.compound_units AS tn WHERE tn.base_unit_id = $1 + UNION ALL + SELECT + c.compare_unit_id + FROM unit_cte AS p, + core.compound_units AS c + WHERE base_unit_id = p.unit_id + ) + + SELECT * FROM unit_cte + WHERE unit_id=$2 + ) THEN + RETURN TRUE; + END IF; + END IF; + RETURN false; +END +$$ +LANGUAGE plpgsql; + +CREATE FUNCTION core.convert_unit(integer, integer) +RETURNS decimal +AS +$$ + DECLARE _factor decimal; +BEGIN + IF(core.get_root_unit_id($1) != core.get_root_unit_id($2)) THEN + RETURN 0; + END IF; + + IF($1 = $2) THEN + RETURN 1.00; + END IF; + + IF(core.is_parent_unit($1, $2)) THEN + WITH RECURSIVE unit_cte(unit_id, value) AS + ( + SELECT tn.compare_unit_id, tn.value + FROM core.compound_units AS tn WHERE tn.base_unit_id = $1 + + UNION ALL + + SELECT + c.compare_unit_id, c.value * p.value + FROM unit_cte AS p, + core.compound_units AS c + WHERE base_unit_id = p.unit_id + ) + SELECT 1.00/value INTO _factor + FROM unit_cte + WHERE unit_id=$2; + ELSE + WITH RECURSIVE unit_cte(unit_id, value) AS + ( + SELECT tn.compare_unit_id, tn.value + FROM core.compound_units AS tn WHERE tn.base_unit_id = $2 + UNION ALL + SELECT + c.compare_unit_id, c.value * p.value + FROM unit_cte AS p, + core.compound_units AS c + WHERE base_unit_id = p.unit_id + ) + + SELECT value INTO _factor + FROM unit_cte + WHERE unit_id=$1; + END IF; + + RETURN _factor; +END +$$ +LANGUAGE plpgsql; + + +CREATE FUNCTION core.get_associated_units(integer) +RETURNS TABLE(unit_id integer, unit_code text, unit_name text) +AS +$$ + DECLARE root_unit_id integer; +BEGIN + CREATE TEMPORARY TABLE IF NOT EXISTS temp_unit(unit_id integer) ON COMMIT DROP; + + SELECT core.get_root_unit_id($1) INTO root_unit_id; + + INSERT INTO temp_unit(unit_id) + SELECT root_unit_id + WHERE NOT EXISTS + ( + SELECT * FROM temp_unit + WHERE temp_unit.unit_id=root_unit_id + ); + + WITH RECURSIVE cte(unit_id) + AS + ( + SELECT + compare_unit_id + FROM + core.compound_units + WHERE + base_unit_id = root_unit_id + + UNION ALL + + SELECT + units.compare_unit_id + FROM + core.compound_units units + INNER JOIN cte + ON cte.unit_id = units.base_unit_id + ) + + INSERT INTO temp_unit(unit_id) + SELECT cte.unit_id FROM cte; + + DELETE FROM temp_unit + WHERE temp_unit.unit_id IS NULL; + + RETURN QUERY + SELECT + core.units.unit_id, + core.units.unit_code::text, + core.units.unit_name::text + FROM + core.units + WHERE + core.units.unit_id + IN + ( + SELECT temp_unit.unit_id FROM temp_unit + ); +END +$$ +LANGUAGE plpgsql; + + +CREATE FUNCTION core.get_associated_units_from_item_id(integer) +RETURNS TABLE(unit_id integer, unit_code text, unit_name text) +AS +$$ +DECLARE _unit_id integer; +BEGIN + SELECT core.items.unit_id INTO _unit_id + FROM core.items + WHERE core.items.item_id=$1; + + RETURN QUERY + SELECT ret.unit_id, ret.unit_code, ret.unit_name + FROM core.get_associated_units(_unit_id) AS ret; + +END +$$ +LANGUAGE plpgsql; + +CREATE FUNCTION core.get_associated_units_from_item_code(text) +RETURNS TABLE(unit_id integer, unit_code text, unit_name text) +AS +$$ +DECLARE _unit_id integer; +BEGIN + SELECT core.items.unit_id INTO _unit_id + FROM core.items + WHERE core.items.item_code=$1; + + RETURN QUERY + SELECT ret.unit_id, ret.unit_code, ret.unit_name + FROM core.get_associated_units(_unit_id) AS ret; + +END +$$ +LANGUAGE plpgsql; + + +CREATE VIEW core.compound_unit_view +AS +SELECT + compound_unit_id, + base_unit.unit_name base_unit_name, + value, + compare_unit.unit_name compare_unit_name +FROM + core.compound_units, + core.units base_unit, + core.units compare_unit +WHERE + core.compound_units.base_unit_id = base_unit.unit_id +AND + core.compound_units.compare_unit_id = compare_unit.unit_id; + + +--TODO +CREATE VIEW core.unit_view +AS +SELECT * FROM core.units; + +CREATE FUNCTION core.get_base_quantity_by_unit_name(text, integer) +RETURNS decimal +AS +$$ +DECLARE _unit_id integer; +DECLARE _root_unit_id integer; +DECLARE _factor decimal; +BEGIN + _unit_id := core.get_unit_id_by_unit_name($1); + _root_unit_id = core.get_root_unit_id(_unit_id); + _factor = core.convert_unit(_unit_id, _root_unit_id); + + RETURN _factor * $2; +END +$$ +LANGUAGE plpgsql; + +CREATE FUNCTION core.get_base_unit_id_by_unit_name(text) +RETURNS integer +AS +$$ +DECLARE _unit_id integer; +BEGIN + _unit_id := core.get_unit_id_by_unit_name($1); + + RETURN + ( + core.get_root_unit_id(_unit_id) + ); +END +$$ +LANGUAGE plpgsql; + +CREATE TABLE core.account_masters +( + account_master_id SERIAL NOT NULL PRIMARY KEY, + account_master_code national character varying(3) NOT NULL, + account_master_name national character varying(40) NOT NULL +); + +CREATE UNIQUE INDEX account_master_code_uix +ON core.account_masters(UPPER(account_master_code)); + +CREATE UNIQUE INDEX account_master_name_uix +ON core.account_masters(UPPER(account_master_name)); + + + +CREATE TABLE core.accounts +( + account_id SERIAL NOT NULL PRIMARY KEY, + account_master_id integer NOT NULL REFERENCES core.account_masters(account_master_id), + account_code national character varying(12) NOT NULL, + external_code national character varying(12) NULL CONSTRAINT accounts_external_code_df DEFAULT(''), + confidential boolean NOT NULL CONSTRAINT accounts_confidential_df DEFAULT(false), + account_name national character varying(100) NOT NULL, + description national character varying(200) NULL, + sys_type boolean NOT NULL CONSTRAINT accounts_sys_type_df DEFAULT(false), + is_cash boolean NOT NULL CONSTRAINT accounts_is_cash_df DEFAULT(false), + parent_account_id integer NULL REFERENCES core.accounts(account_id), + audit_user_id integer NULL REFERENCES office.users(user_id), + audit_ts TIMESTAMP WITH TIME ZONE NULL DEFAULT(NOW()) +); + + +CREATE UNIQUE INDEX accountsCode_uix +ON core.accounts(UPPER(account_code)); + +CREATE UNIQUE INDEX accounts_Name_uix +ON core.accounts(UPPER(account_name)); + +CREATE FUNCTION core.has_child_accounts(integer) +RETURNS boolean +AS +$$ +BEGIN + IF EXISTS(SELECT 0 FROM core.accounts WHERE parent_account_id=$1 LIMIT 1) THEN + RETURN true; + END IF; + + RETURN false; +END +$$ +LANGUAGE plpgsql; + + +CREATE FUNCTION core.get_cash_account_id() +RETURNS integer +AS +$$ +BEGIN + RETURN + ( + SELECT account_id + FROM core.accounts + WHERE is_cash=true + LIMIT 1 + ); +END +$$ +LANGUAGE plpgsql; + +CREATE VIEW core.account_view +AS +SELECT + core.accounts.account_id, + core.account_masters.account_master_code, + core.accounts.account_code, + core.accounts.external_code, + core.accounts.account_name, + core.accounts.confidential, + core.accounts.description, + core.accounts.sys_type, + core.accounts.is_cash, + parent_account.account_code || ' (' || parent_account.account_name || ')' AS parent, + core.has_child_accounts(core.accounts.account_id) AS has_child +FROM core.accounts +INNER JOIN core.account_masters +ON core.account_masters.account_master_id=core.accounts.account_master_id +LEFT JOIN core.accounts parent_account +ON parent_account.account_id=core.accounts.parent_account_id; + +INSERT INTO core.account_masters(account_master_code, account_master_name) SELECT 'BSA', 'Balance Sheet A/C'; +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '10000', 'Assets', TRUE, (SELECT account_id FROM core.accounts WHERE account_name='Balance Sheet A/C'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '10001', 'Current Assets', TRUE, (SELECT account_id FROM core.accounts WHERE account_name='Assets'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '10100', 'Cash at Bank A/C', TRUE, (SELECT account_id FROM core.accounts WHERE account_name='Current Assets'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '10110', 'Regular Checking Account', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Cash at Bank A/C'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '10120', 'Payroll Checking Account', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Cash at Bank A/C'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '10130', 'Savings Account', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Cash at Bank A/C'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '10140', 'Special Account', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Cash at Bank A/C'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id, is_cash) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '10200', 'Cash in Hand A/C', TRUE, (SELECT account_id FROM core.accounts WHERE account_name='Current Assets'), true; +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '10300', 'Investments', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Current Assets'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '10310', 'Short Term Investment', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Investments'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '10320', 'Other Investments', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Investments'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '10321', 'Investments-Money Market', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Other Investments'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '10322', 'Bank Deposit Contract (Fixed Deposit)', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Other Investments'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '10323', 'Investments-Certificates of Deposit', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Other Investments'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '10400', 'Accounts Receivable', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Current Assets'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '10500', 'Other Receivables', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Current Assets'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '10600', 'Allowance for Doubtful Accounts', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Current Assets'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '10700', 'Inventory', TRUE, (SELECT account_id FROM core.accounts WHERE account_name='Current Assets'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '10720', 'Raw Materials Inventory', TRUE, (SELECT account_id FROM core.accounts WHERE account_name='Inventory'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '10730', 'Supplies Inventory', TRUE, (SELECT account_id FROM core.accounts WHERE account_name='Inventory'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '10740', 'Work in Progress Inventory', TRUE, (SELECT account_id FROM core.accounts WHERE account_name='Inventory'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '10750', 'Finished Goods Inventory', TRUE, (SELECT account_id FROM core.accounts WHERE account_name='Inventory'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '10800', 'Prepaid Expenses', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Current Assets'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '10900', 'Employee Advances', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Current Assets'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '11000', 'Notes Receivable-Current', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Current Assets'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '11100', 'Prepaid Interest', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Current Assets'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '11200', 'Accrued Incomes (Assets)', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Current Assets'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '11300', 'Other Debtors', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Current Assets'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '11400', 'Other Current Assets', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Current Assets'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '12001', 'Noncurrent Assets', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Assets'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '12100', 'Furniture and Fixtures', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Noncurrent Assets'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '12200', 'Plants & Equipments', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Noncurrent Assets'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '12300', 'Rental Property', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Noncurrent Assets'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '12400', 'Vehicles', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Noncurrent Assets'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '12500', 'Intangibles', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Noncurrent Assets'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '12600', 'Other Depreciable Properties', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Noncurrent Assets'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '12700', 'Leasehold Improvements', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Noncurrent Assets'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '12800', 'Buildings', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Noncurrent Assets'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '12900', 'Building Improvements', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Noncurrent Assets'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '13000', 'Interior Decorations', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Noncurrent Assets'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '13100', 'Land', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Noncurrent Assets'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '13200', 'Long Term Investments', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Noncurrent Assets'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '13300', 'Trade Debtors', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Noncurrent Assets'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '13400', 'Rental Debtors', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Noncurrent Assets'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '13500', 'Staff Debtors', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Noncurrent Assets'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '13600', 'Other Noncurrent Debtors', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Noncurrent Assets'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '13700', 'Other Financial Assets', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Noncurrent Assets'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '13710', 'Deposits Held', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Other Financial Assets'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '13800', 'Accumulated Depreciations', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Noncurrent Assets'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '13810', 'Accumulated Depreciation-Furniture and Fixtures', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Accumulated Depreciations'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '13820', 'Accumulated Depreciation-Equipment', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Accumulated Depreciations'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '13830', 'Accumulated Depreciation-Vehicles', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Accumulated Depreciations'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '13840', 'Accumulated Depreciation-Other Depreciable Properties', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Accumulated Depreciations'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '13850', 'Accumulated Depreciation-Leasehold', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Accumulated Depreciations'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '13860', 'Accumulated Depreciation-Buildings', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Accumulated Depreciations'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '13870', 'Accumulated Depreciation-Building Improvements', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Accumulated Depreciations'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '13880', 'Accumulated Depreciation-Interior Decorations', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Accumulated Depreciations'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '14001', 'Other Assets', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Assets'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '14100', 'Other Assets-Deposits', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Other Assets'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '14200', 'Other Assets-Organization Costs', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Other Assets'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '14300', 'Other Assets-Accumulated Amortization-Organization Costs', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Other Assets'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '14400', 'Notes Receivable-Non-current', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Other Assets'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '14500', 'Other Non-current Assets', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Other Assets'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '14600', 'Nonfinancial Assets', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Other Assets'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '20000', 'Liabilities', TRUE, (SELECT account_id FROM core.accounts WHERE account_name='Balance Sheet A/C'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '20001', 'Current Liabilities', TRUE, (SELECT account_id FROM core.accounts WHERE account_name='Liabilities'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '20100', 'Accounts Payable', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Current Liabilities'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '20110', 'Shipping Charge Payable', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Current Liabilities'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '20200', 'Accrued Expenses', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Current Liabilities'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '20300', 'Wages Payable', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Current Liabilities'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '20400', 'Deductions Payable', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Current Liabilities'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '20500', 'Health Insurance Payable', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Current Liabilities'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '20600', 'Superannutation Payable', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Current Liabilities'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '20700', 'Tax Payables', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Current Liabilities'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '20710', 'Sales Tax Payable', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Tax Payables'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '20720', 'Federal Payroll Taxes Payable', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Tax Payables'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '20730', 'FUTA Tax Payable', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Tax Payables'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '20740', 'State Payroll Taxes Payable', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Tax Payables'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '20750', 'SUTA Payable', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Tax Payables'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '20760', 'Local Payroll Taxes Payable', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Tax Payables'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '20770', 'Income Taxes Payable', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Tax Payables'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '20780', 'Other Taxes Payable', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Tax Payables'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '20800', 'Employee Benefits Payable', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Current Liabilities'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '20810', 'Provision for Annual Leave', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Employee Benefits Payable'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '20820', 'Provision for Long Service Leave', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Employee Benefits Payable'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '20830', 'Provision for Personal Leave', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Employee Benefits Payable'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '20840', 'Provision for Health Leave', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Employee Benefits Payable'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '20900', 'Current Portion of Long-term Debt', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Current Liabilities'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '21000', 'Advance Incomes', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Current Liabilities'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '21010', 'Advance Sales Income', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Advance Incomes'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '21020', 'Grant Received in Advance', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Advance Incomes'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '21100', 'Deposits from Customers', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Current Liabilities'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '21200', 'Other Current Liabilities', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Current Liabilities'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '21210', 'Short Term Loan Payables', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Other Current Liabilities'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '21220', 'Short Term Hirepurchase Payables', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Other Current Liabilities'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '21230', 'Short Term Lease Liability', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Other Current Liabilities'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '21240', 'Grants Repayable', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Other Current Liabilities'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '24001', 'Noncurrent Liabilities', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Liabilities'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '24100', 'Notes Payable', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Noncurrent Liabilities'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '24200', 'Land Payable', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Noncurrent Liabilities'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '24300', 'Equipment Payable', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Noncurrent Liabilities'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '24400', 'Vehicles Payable', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Noncurrent Liabilities'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '24500', 'Lease Liability', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Noncurrent Liabilities'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '24600', 'Loan Payable', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Noncurrent Liabilities'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '24700', 'Hirepurchase Payable', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Noncurrent Liabilities'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '24800', 'Bank Loans Payable', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Noncurrent Liabilities'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '24900', 'Deferred Revenue', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Noncurrent Liabilities'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '25000', 'Other Long-term Liabilities', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Noncurrent Liabilities'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '25010', 'Long Term Employee Benefit Provision', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Other Long-term Liabilities'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '28001', 'Equity', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Liabilities'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '28100', 'Stated Capital', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Equity'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '28110', 'Founder Capital', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Stated Capital'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '28120', 'Promoter Capital', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Stated Capital'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '28130', 'Member Capital', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Stated Capital'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '28200', 'Capital Surplus', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Equity'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '28210', 'Share Premium', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Capital Surplus'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '28220', 'Capital Redemption Reserves', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Capital Surplus'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '28230', 'Statutory Reserves', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Capital Surplus'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '28240', 'Asset Revaluation Reserves', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Capital Surplus'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '28250', 'Exchange Rate Fluctuation Reserves', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Capital Surplus'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '28260', 'Capital Reserves Arising From Merger', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Capital Surplus'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '28270', 'Capital Reserves Arising From Acuisition', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Capital Surplus'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '28300', 'Retained Surplus', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Equity'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '28310', 'Accumulated Profits', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Retained Surplus'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '28320', 'Accumulated Losses', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Retained Surplus'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '28400', 'Treasury Stock', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Equity'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '28500', 'Current Year Surplus', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Equity'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '28600', 'General Reserves', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Equity'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '28700', 'Other Reserves', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Equity'); +INSERT INTO core.account_masters(account_master_code, account_master_name) SELECT 'PLA', 'Profit and Loss A/C'; +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '30000', 'Revenues', TRUE, (SELECT account_id FROM core.accounts WHERE account_name='Profit and Loss A/C'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '30100', 'Sales A/C', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Revenues'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '30200', 'Interest Income', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Revenues'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '30300', 'Other Income', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Revenues'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '30400', 'Finance Charge Income', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Revenues'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '30500', 'Shipping Charges Reimbursed', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Revenues'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '30600', 'Sales Returns and Allowances', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Revenues'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '30700', 'Sales Discounts', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Revenues'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '40000', 'Expenses', TRUE, (SELECT account_id FROM core.accounts WHERE account_name='Profit and Loss A/C'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '40100', 'Purchase A/C', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Expenses'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '40200', 'Cost of GoodS Sold', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Expenses'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '40205', 'Product Cost', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Cost of GoodS Sold'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '40210', 'Raw Material Purchases', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Cost of GoodS Sold'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '40215', 'Direct Labor Costs', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Cost of GoodS Sold'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '40220', 'Indirect Labor Costs', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Cost of GoodS Sold'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '40225', 'Heat and Power', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Cost of GoodS Sold'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '40230', 'Commissions', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Cost of GoodS Sold'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '40235', 'Miscellaneous Factory Costs', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Cost of GoodS Sold'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '40240', 'Cost of Goods Sold-Salaries and Wages', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Cost of GoodS Sold'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '40245', 'Cost of Goods Sold-Contract Labor', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Cost of GoodS Sold'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '40250', 'Cost of Goods Sold-Freight', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Cost of GoodS Sold'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '40255', 'Cost of Goods Sold-Other', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Cost of GoodS Sold'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '40260', 'Inventory Adjustments', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Cost of GoodS Sold'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '40265', 'Purchase Returns and Allowances', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Cost of GoodS Sold'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '40270', 'Purchase Discounts', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Cost of GoodS Sold'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '40300', 'General Purchase Expenses', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Expenses'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '40400', 'Advertising Expenses', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Expenses'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '40500', 'Amortization Expenses', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Expenses'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '40600', 'Auto Expenses', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Expenses'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '40700', 'Bad Debt Expenses', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Expenses'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '40800', 'Bank Fees', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Expenses'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '40900', 'Cash Over and Short', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Expenses'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '41000', 'Charitable Contributions Expenses', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Expenses'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '41100', 'Commissions and Fees Expenses', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Expenses'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '41200', 'Depreciation Expenses', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Expenses'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '41300', 'Dues and Subscriptions Expenses', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Expenses'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '41400', 'Employee Benefit Expenses', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Expenses'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '41410', 'Employee Benefit Expenses-Health Insurance', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Employee Benefit Expenses'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '41420', 'Employee Benefit Expenses-Pension Plans', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Employee Benefit Expenses'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '41430', 'Employee Benefit Expenses-Profit Sharing Plan', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Employee Benefit Expenses'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '41440', 'Employee Benefit Expenses-Other', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Employee Benefit Expenses'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '41500', 'Freight Expenses', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Expenses'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '41600', 'Gifts Expenses', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Expenses'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '41700', 'Income Tax Expenses', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Expenses'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '41710', 'Income Tax Expenses-Federal', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Income Tax Expenses'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '41720', 'Income Tax Expenses-State', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Income Tax Expenses'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '41730', 'Income Tax Expenses-Local', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Income Tax Expenses'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '41800', 'Insurance Expenses', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Expenses'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '41810', 'Insurance Expenses-Product Liability', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Insurance Expenses'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '41820', 'Insurance Expenses-Vehicle', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Insurance Expenses'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '41900', 'Interest Expenses', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Expenses'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '42000', 'Laundry and Dry Cleaning Expenses', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Expenses'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '42100', 'Legal and Professional Expenses', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Expenses'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '42200', 'Licenses Expenses', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Expenses'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '42300', 'Loss on NSF Checks', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Expenses'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '42400', 'Maintenance Expenses', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Expenses'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '42500', 'Meals and Entertainment Expenses', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Expenses'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '42600', 'Office Expenses', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Expenses'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '42700', 'Payroll Tax Expenses', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Expenses'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '42800', 'Penalties and Fines Expenses', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Expenses'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '42900', 'Other Taxe Expenses', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Expenses'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '43000', 'Postage Expenses', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Expenses'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '43100', 'Rent or Lease Expenses', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Expenses'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '43200', 'Repair and Maintenance Expenses', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Expenses'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '43210', 'Repair and Maintenance Expenses-Office', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Repair and Maintenance Expenses'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '43220', 'Repair and Maintenance Expenses-Vehicle', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Repair and Maintenance Expenses'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '43300', 'Supplies Expenses-Office', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Expenses'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '43400', 'Telephone Expenses', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Expenses'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '43500', 'Training Expenses', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Expenses'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '43600', 'Travel Expenses', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Expenses'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '43700', 'Salary Expenses', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Expenses'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '43800', 'Wages Expenses', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Expenses'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '43900', 'Utilities Expenses', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Expenses'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '44000', 'Other Expenses', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Expenses'); +INSERT INTO core.accounts(account_master_id,account_code,account_name, sys_type, parent_account_id) SELECT (SELECT account_master_id FROM core.account_masters WHERE account_master_code='BSA'), '44100', 'Gain/Loss on Sale of Assets', FALSE, (SELECT account_id FROM core.accounts WHERE account_name='Expenses'); +INSERT INTO core.account_masters(account_master_code, account_master_name) SELECT 'OBS', 'Off Balance Sheet A/C'; + +CREATE FUNCTION core.disable_editing_sys_type() +RETURNS TRIGGER +AS +$$ +BEGIN + IF TG_OP='UPDATE' OR TG_OP='DELETE' THEN + IF EXISTS + ( + SELECT * + FROM core.accounts + WHERE (sys_type=true OR is_cash=true) + AND account_id=OLD.account_id + ) THEN + RAISE EXCEPTION 'You are not allowed to change system accounts.'; + END IF; + RETURN OLD; + END IF; + + IF TG_OP='INSERT' THEN + IF (NEW.sys_type=true OR NEW.is_cash=true) THEN + RAISE EXCEPTION 'You are not allowed to add system accounts.'; + END IF; + RETURN NEW; + END IF; + +END +$$ +LANGUAGE plpgsql; + +CREATE TRIGGER restrict_delete_sys_type_trigger +BEFORE DELETE +ON core.accounts +FOR EACH ROW EXECUTE PROCEDURE core.disable_editing_sys_type(); + +CREATE TRIGGER restrict_update_sys_type_trigger +BEFORE UPDATE +ON core.accounts +FOR EACH ROW EXECUTE PROCEDURE core.disable_editing_sys_type(); + +CREATE TRIGGER restrict_insert_sys_type_trigger +BEFORE INSERT +ON core.accounts +FOR EACH ROW EXECUTE PROCEDURE core.disable_editing_sys_type(); + +CREATE VIEW core.accounts_view +AS +SELECT + core.accounts.account_id, + core.accounts.account_code, + core.accounts.account_name, + core.accounts.description, + core.accounts.sys_type, + core.accounts.parent_account_id, + parent_accounts.account_code AS parent_account_code, + parent_accounts.account_name AS parent_account_name, + core.account_masters.account_master_id, + core.account_masters.account_master_code, + core.account_masters.account_master_name +FROM + core.account_masters + INNER JOIN core.accounts + ON core.account_masters.account_master_id = core.accounts.account_master_id + LEFT OUTER JOIN core.accounts AS parent_accounts + ON core.accounts.parent_account_id = parent_accounts.account_id; + + +CREATE FUNCTION core.get_account_id_by_account_code(text) +RETURNS integer +AS +$$ +BEGIN + RETURN + ( + SELECT account_id + FROM core.accounts + WHERE account_code=$1 + ); +END +$$ +LANGUAGE plpgsql; + + +CREATE TABLE core.account_parameters +( + account_parameter_id SERIAL NOT NULL CONSTRAINT account_parameters_pk PRIMARY KEY, + parameter_name national character varying(128) NOT NULL, + account_id integer NOT NULL REFERENCES core.accounts(account_id), + audit_user_id integer NULL REFERENCES office.users(user_id), + audit_ts TIMESTAMP WITH TIME ZONE NULL DEFAULT(NOW()) +); + +CREATE UNIQUE INDEX account_parameters_parameter_name_uix +ON core.account_parameters(UPPER(parameter_name)); + +INSERT INTO core.account_parameters(parameter_name, account_id) +SELECT 'Sales', core.get_account_id_by_account_code('30100') UNION ALL +SELECT 'Sales.Receivables', core.get_account_id_by_account_code('10400') UNION ALL +SELECT 'Sales.Discount', core.get_account_id_by_account_code('30700') UNION ALL +SELECT 'Sales.Tax', core.get_account_id_by_account_code('20700') UNION ALL +SELECT 'Purchase', core.get_account_id_by_account_code('40100') UNION ALL +SELECT 'Purchase.Payables', core.get_account_id_by_account_code('20100') UNION ALL +SELECT 'Purchase.Discount', core.get_account_id_by_account_code('40270') UNION ALL +SELECT 'Purchase.Tax', core.get_account_id_by_account_code('20700') UNION ALL +SELECT 'Inventory', core.get_account_id_by_account_code('10700') UNION ALL +SELECT 'COGS', core.get_account_id_by_account_code('40200'); + +CREATE FUNCTION core.get_account_id_by_parameter(text) +RETURNS integer +AS +$$ +BEGIN + RETURN + ( + SELECT + account_id + FROM + core.account_parameters + WHERE + parameter_name=$1 + ); +END +$$ +LANGUAGE plpgsql; + +CREATE FUNCTION core.get_account_name(integer) +RETURNS text +AS +$$ +BEGIN + RETURN + ( + SELECT + account_name + FROM + core.accounts + WHERE + account_id=$1 + ); +END +$$ +LANGUAGE plpgsql; + +CREATE TABLE core.bank_accounts +( + account_id integer NOT NULL CONSTRAINT bank_accounts_pk PRIMARY KEY + CONSTRAINT bank_accounts_accounts_fk REFERENCES core.accounts(account_id), + maintained_by_user_id integer NOT NULL CONSTRAINT bank_accounts_users_fk REFERENCES office.users(user_id), + bank_name national character varying(128) NOT NULL, + bank_branch national character varying(128) NOT NULL, + bank_contact_number national character varying(128) NULL, + bank_address text NULL, + bank_account_code national character varying(128) NULL, + bank_account_type national character varying(128) NULL, + relationship_officer_name national character varying(128) NULL, + audit_user_id integer NULL REFERENCES office.users(user_id), + audit_ts TIMESTAMP WITH TIME ZONE NULL DEFAULT(NOW()) +); + + +CREATE VIEW core.bank_account_view +AS +SELECT + core.accounts.account_id, + core.accounts.account_code, + core.accounts.account_name, + office.users.user_name AS maintained_by, + core.bank_accounts.bank_name, + core.bank_accounts.bank_branch, + core.bank_accounts.bank_contact_number, + core.bank_accounts.bank_address, + core.bank_accounts.bank_account_code, + core.bank_accounts.bank_account_type, + core.bank_accounts.relationship_officer_name AS relation_officer +FROM + core.bank_accounts +INNER JOIN core.accounts ON core.accounts.account_id = core.bank_accounts.account_id +INNER JOIN office.users ON core.bank_accounts.maintained_by_user_id = office.users.user_id; + +CREATE TABLE core.agents +( + agent_id SERIAL NOT NULL PRIMARY KEY, + agent_code national character varying(12) NOT NULL, + agent_name national character varying(100) NOT NULL, + address national character varying(100) NOT NULL, + contact_number national character varying(50) NOT NULL, + commission_rate decimal_strict2 NOT NULL DEFAULT(0), + account_id integer NOT NULL REFERENCES core.accounts(account_id), + audit_user_id integer NULL REFERENCES office.users(user_id), + audit_ts TIMESTAMP WITH TIME ZONE NULL DEFAULT(NOW()) +); + +CREATE UNIQUE INDEX agents_agent_name_uix +ON core.agents(UPPER(agent_name)); + +INSERT INTO core.agents(agent_code, agent_name, address, contact_number, commission_rate, account_id) +SELECT 'OFF', 'Office', 'Office', '', 0, (SELECT account_id FROM core.accounts WHERE account_code='20100'); + +CREATE VIEW core.agent_view +AS +SELECT + agent_id, + agent_code, + agent_name, + address, + contact_number, + commission_rate, + account_name +FROM + core.agents, + core.accounts +WHERE + core.agents.account_id = core.accounts.account_id; + +CREATE TABLE core.bonus_slabs +( + bonus_slab_id SERIAL NOT NULL PRIMARY KEY, + bonus_slab_code national character varying(12) NOT NULL, + bonus_slab_name national character varying(50) NOT NULL, + checking_frequency_id integer NOT NULL REFERENCES core.frequencies(frequency_id), + audit_user_id integer NULL REFERENCES office.users(user_id), + audit_ts TIMESTAMP WITH TIME ZONE NULL DEFAULT(NOW()) +); + +CREATE UNIQUE INDEX bonus_slabs_bonus_slab_code_uix +ON core.bonus_slabs(UPPER(bonus_slab_code)); + + +CREATE UNIQUE INDEX bonus_slabs_bonus_slab_name_uix +ON core.bonus_slabs(UPPER(bonus_slab_name)); + + +CREATE VIEW core.bonus_slab_view +AS +SELECT + bonus_slab_id, + bonus_slab_code, + bonus_slab_name, + checking_frequency_id, + frequency_name +FROM +core.bonus_slabs, core.frequencies +WHERE +core.bonus_slabs.checking_frequency_id = core.frequencies.frequency_id; + +CREATE TABLE core.bonus_slab_details +( + bonus_slab_detail_id SERIAL NOT NULL PRIMARY KEY, + bonus_slab_id integer NOT NULL REFERENCES core.bonus_slabs(bonus_slab_id), + amount_from money_strict NOT NULL, + amount_to money_strict NOT NULL, + bonus_rate decimal_strict NOT NULL, + audit_user_id integer NULL REFERENCES office.users(user_id), + audit_ts TIMESTAMP WITH TIME ZONE NULL DEFAULT(NOW()), + CONSTRAINT bonus_slab_details_amounts_chk CHECK(amount_to>amount_from) +); + + +CREATE VIEW core.bonus_slab_detail_view +AS +SELECT + bonus_slab_detail_id, + core.bonus_slab_details.bonus_slab_id, + core.bonus_slabs.bonus_slab_name AS slab_name, + amount_from, + amount_to, + bonus_rate +FROM + core.bonus_slab_details, + core.bonus_slabs +WHERE + core.bonus_slab_details.bonus_slab_id = core.bonus_slabs.bonus_slab_id; + +CREATE TABLE core.agent_bonus_setups +( + agent_bonus_setup_id SERIAL NOT NULL PRIMARY KEY, + agent_id integer NOT NULL REFERENCES core.agents(agent_id), + bonus_slab_id integer NOT NULL REFERENCES core.bonus_slabs(bonus_slab_id) +); + +CREATE UNIQUE INDEX agent_bonus_setups_uix +ON core.agent_bonus_setups(agent_id, bonus_slab_id); + + +CREATE VIEW core.agent_bonus_setup_view +AS +SELECT + agent_bonus_setup_id, + agent_name, + bonus_slab_name +FROM + core.agent_bonus_setups, + core.agents, + core.bonus_slabs +WHERE + core.agent_bonus_setups.agent_id = core.agents.agent_id +AND + core.agent_bonus_setups.bonus_slab_id = core.bonus_slabs.bonus_slab_id; + +CREATE TABLE core.ageing_slabs +( + ageing_slab_id SERIAL NOT NULL PRIMARY KEY, + ageing_slab_name national character varying(24) NOT NULL, + from_days integer NOT NULL, + to_days integer NOT NULL CHECK(to_days > 0) +); + +CREATE UNIQUE INDEX ageing_slabs_ageing_slab_name_uix +ON core.ageing_slabs(UPPER(ageing_slab_name)); + +INSERT INTO core.ageing_slabs(ageing_slab_name,from_days,to_days) +SELECT 'SLAB 1',0, 30 UNION ALL +SELECT 'SLAB 2',31, 60 UNION ALL +SELECT 'SLAB 3',61, 90 UNION ALL +SELECT 'SLAB 4',91, 365 UNION ALL +SELECT 'SLAB 5',366, 999999; + + +CREATE TABLE core.party_types +( + party_type_id SERIAL NOT NULL PRIMARY KEY, + party_type_code national character varying(12) NOT NULL, + party_type_name national character varying(50) NOT NULL, + is_supplier boolean NOT NULL CONSTRAINT party_types_is_supplier_df DEFAULT(false), + audit_user_id integer NULL REFERENCES office.users(user_id), + audit_ts TIMESTAMP WITH TIME ZONE NULL DEFAULT(NOW()) +); + +INSERT INTO core.party_types(party_type_code, party_type_name) SELECT 'A', 'Agent'; +INSERT INTO core.party_types(party_type_code, party_type_name) SELECT 'C', 'Customer'; +INSERT INTO core.party_types(party_type_code, party_type_name) SELECT 'D', 'Dealer'; +INSERT INTO core.party_types(party_type_code, party_type_name, is_supplier) SELECT 'S', 'Supplier', true; + +CREATE TABLE core.parties +( + party_id BIGSERIAL NOT NULL PRIMARY KEY, + party_type_id smallint NOT NULL REFERENCES core.party_types(party_type_id), + party_code national character varying(12) NULL, + first_name national character varying(50) NOT NULL, + middle_name national character varying(50) NULL, + last_name national character varying(50) NOT NULL, + party_name text NULL, + date_of_birth date NULL, + address_line_1 national character varying(128) NULL, + address_line_2 national character varying(128) NULL, + street national character varying(50) NULL, + city national character varying(50) NULL, + state national character varying(50) NULL, + country national character varying(50) NULL, + phone national character varying(24) NULL, + fax national character varying(24) NULL, + cell national character varying(24) NULL, + email national character varying(128) NULL, + url national character varying(50) NULL, + pan_number national character varying(50) NULL, + sst_number national character varying(50) NULL, + cst_number national character varying(50) NULL, + allow_credit boolean NULL, + maximum_credit_period smallint NULL, + maximum_credit_amount money_strict2 NULL, + charge_interest boolean NULL, + interest_rate decimal NULL, + interest_compounding_frequency_id smallint NULL REFERENCES core.frequencies(frequency_id), + account_id integer NOT NULL REFERENCES core.accounts(account_id), + audit_user_id integer NULL REFERENCES office.users(user_id), + audit_ts TIMESTAMP WITH TIME ZONE NULL DEFAULT(NOW()) +); + + +CREATE UNIQUE INDEX parties_party_code_uix +ON core.parties(UPPER(party_code)); + +/******************************************************************* + GET UNIQUE EIGHT-TO-TEN DIGIT CUSTOMER CODE + TO IDENTIFY A PARTY. + BASIC FORMULA: + 1. FIRST TWO LETTERS OF FIRST NAME + 2. FIRST LETTER OF MIDDLE NAME (IF AVAILABLE) + 3. FIRST TWO LETTERS OF LAST NAME + 4. CUSTOMER NUMBER +*******************************************************************/ + +CREATE OR REPLACE FUNCTION core.get_party_code +( + text, --First Name + text, --Middle Name + text --Last Name +) +RETURNS text AS +$$ + DECLARE _party_code TEXT; +BEGIN + SELECT INTO + _party_code + party_code + FROM + core.parties + WHERE + party_code LIKE + UPPER(left($1,2) || + CASE + WHEN $2 IS NULL or $2 = '' + THEN left($3,3) + ELSE + left($2,1) || left($3,2) + END + || '%') + ORDER BY party_code desc + LIMIT 1; + + _party_code := + UPPER + ( + left($1,2)|| + CASE + WHEN $2 IS NULL or $2 = '' + THEN left($3,3) + ELSE + left($2,1)||left($3,2) + END + ) + || '-' || + CASE + WHEN _party_code IS NULL + THEN '0001' + ELSE + to_char(CAST(right(_party_code,4) AS integer)+1,'FM0000') + END; + RETURN _party_code; +END; +$$ +LANGUAGE 'plpgsql'; + + +CREATE FUNCTION core.update_party_code() +RETURNS trigger +AS +$$ +BEGIN + UPDATE core.parties + SET + party_code=core.get_party_code(NEW.first_name, NEW.middle_name, NEW.last_name) + WHERE core.parties.party_id=NEW.party_id; + + RETURN NEW; +END +$$ +LANGUAGE plpgsql; + +CREATE TRIGGER update_party_code +AFTER INSERT +ON core.parties +FOR EACH ROW EXECUTE PROCEDURE core.update_party_code(); + + +CREATE FUNCTION core.get_party_type_id_by_party_code(text) +RETURNS smallint +AS +$$ +BEGIN + RETURN + ( + SELECT + party_type_id + FROM + core.parties + WHERE + core.parties.party_code=$1 + ); +END +$$ +LANGUAGE plpgsql; + + +CREATE FUNCTION core.get_party_id_by_party_code(text) +RETURNS smallint +AS +$$ +BEGIN + RETURN + ( + SELECT + party_id + FROM + core.parties + WHERE + core.parties.party_code=$1 + ); +END +$$ +LANGUAGE plpgsql; + +CREATE VIEW core.party_view +AS +SELECT + core.parties.party_id, + core.party_types.party_type_code || ' (' || core.party_types.party_type_name || ')' AS party_type, + core.parties.party_code, + core.parties.first_name, + core.parties.middle_name, + core.parties.last_name, + core.parties.party_name, + core.parties.address_line_1, + core.parties.address_line_2, + core.parties.street, + core.parties.city, + core.parties.state, + core.parties.country, + core.parties.allow_credit, + core.parties.maximum_credit_period, + core.parties.maximum_credit_amount, + core.parties.charge_interest, + core.parties.interest_rate, + core.parties.pan_number, + core.parties.sst_number, + core.parties.cst_number, + core.parties.phone, + core.parties.fax, + core.parties.cell, + core.parties.email, + core.parties.url +FROM +core.parties +INNER JOIN +core.party_types +ON core.parties.party_type_id = core.party_types.party_type_id; + +CREATE FUNCTION core.is_supplier(int) +RETURNS boolean +AS +$$ +BEGIN + IF EXISTS + ( + SELECT 1 FROM core.parties + INNER JOIN core.party_types + ON core.parties.party_type_id=core.party_types.party_type_id + WHERE core.parties.party_id=$1 + AND core.party_types.is_supplier=true + ) THEN + RETURN true; + END IF; + + RETURN false; +END +$$ +LANGUAGE plpgsql; + +CREATE TABLE core.shipping_addresses +( + shipping_address_id BIGSERIAL NOT NULL PRIMARY KEY, + shipping_address_code national character varying(24) NOT NULL, + party_id bigint NOT NULL REFERENCES core.parties(party_id), + address_line_1 national character varying(128) NULL, + address_line_2 national character varying(128) NULL, + street national character varying(128) NULL, + city national character varying(128) NOT NULL, + state national character varying(128) NOT NULL, + country national character varying(128) NOT NULL, + audit_user_id integer NULL REFERENCES office.users(user_id), + audit_ts TIMESTAMP WITH TIME ZONE NULL DEFAULT(NOW()) +); + +CREATE UNIQUE INDEX shipping_addresses_shipping_address_code_uix +ON core.shipping_addresses(UPPER(shipping_address_code), party_id); + +CREATE FUNCTION core.get_shipping_address_id_by_shipping_address_code(text) +RETURNS smallint +AS +$$ +BEGIN + RETURN + ( + SELECT + shipping_address_id + FROM + core.shipping_addresses + WHERE + core.shipping_addresses.shipping_address_code=$1 + ); +END +$$ +LANGUAGE plpgsql; + +CREATE FUNCTION core.update_shipping_address_code_trigger() +RETURNS TRIGGER +AS +$$ +DECLARE _counter integer; +BEGIN + IF TG_OP='INSERT' THEN + + SELECT COALESCE(MAX(shipping_address_code::integer), 0) + 1 + INTO _counter + FROM core.shipping_addresses + WHERE party_id=NEW.party_id; + + NEW.shipping_address_code := trim(to_char(_counter, '000')); + + RETURN NEW; + END IF; +END +$$ +LANGUAGE plpgsql; + + +CREATE TRIGGER update_shipping_address_code_trigger +BEFORE INSERT +ON core.shipping_addresses +FOR EACH ROW EXECUTE PROCEDURE core.update_shipping_address_code_trigger(); + +CREATE VIEW core.shipping_address_view +AS +SELECT + core.shipping_addresses.shipping_address_id, + core.shipping_addresses.shipping_address_code, + core.shipping_addresses.party_id, + core.parties.party_code || ' (' || core.parties.party_name || ')' AS party, + core.shipping_addresses.address_line_1, + core.shipping_addresses.address_line_2, + core.shipping_addresses.street, + core.shipping_addresses.city, + core.shipping_addresses.state, + core.shipping_addresses.country +FROM core.shipping_addresses +INNER JOIN core.parties +ON core.shipping_addresses.party_id=core.parties.party_id; + +CREATE TABLE core.brands +( + brand_id SERIAL NOT NULL PRIMARY KEY, + brand_code national character varying(12) NOT NULL, + brand_name national character varying(150) NOT NULL +); + +CREATE UNIQUE INDEX brands_brand_code_uix +ON core.brands(UPPER(brand_code)); + +CREATE UNIQUE INDEX brands_brand_name_uix +ON core.brands(UPPER(brand_name)); + +INSERT INTO core.brands(brand_code, brand_name) +SELECT 'DEF', 'Default'; + + +CREATE TABLE core.shippers +( + shipper_id BIGSERIAL NOT NULL PRIMARY KEY, + shipper_code national character varying(12) NULL, + company_name national character varying(128) NOT NULL, + shipper_name national character varying(150) NULL, + address_line_1 national character varying(128) NULL, + address_line_2 national character varying(128) NULL, + street national character varying(50) NULL, + city national character varying(50) NULL, + state national character varying(50) NULL, + country national character varying(50) NULL, + phone national character varying(50) NULL, + fax national character varying(50) NULL, + cell national character varying(50) NULL, + email national character varying(128) NULL, + url national character varying(50) NULL, + contact_person national character varying(50) NULL, + contact_address_line_1 national character varying(128) NULL, + contact_address_line_2 national character varying(128) NULL, + contact_street national character varying(50) NULL, + contact_city national character varying(50) NULL, + contact_state national character varying(50) NULL, + contact_country national character varying(50) NULL, + contact_email national character varying(128) NULL, + contact_phone national character varying(50) NULL, + contact_cell national character varying(50) NULL, + factory_address national character varying(250) NULL, + pan_number national character varying(50) NULL, + sst_number national character varying(50) NULL, + cst_number national character varying(50) NULL, + account_id integer NOT NULL REFERENCES core.accounts(account_id), + audit_user_id integer NULL REFERENCES office.users(user_id), + audit_ts TIMESTAMP WITH TIME ZONE NULL DEFAULT(NOW()) +); + + +CREATE UNIQUE INDEX shippers_shipper_code_uix +ON core.shippers(UPPER(shipper_code)); + + +/******************************************************************* + GET UNIQUE EIGHT-TO-TEN DIGIT shipper CODE + TO IDENTIFY A shipper. + BASIC FORMULA: + 1. FIRST TWO LETTERS OF FIRST NAME + 2. FIRST LETTER OF MIDDLE NAME (IF AVAILABLE) + 3. FIRST TWO LETTERS OF LAST NAME + 4. shipper NUMBER +*******************************************************************/ + +CREATE OR REPLACE FUNCTION core.get_shipper_code +( + text --company name +) +RETURNS text AS +$$ + DECLARE __shipper_code TEXT; +BEGIN + SELECT INTO + __shipper_code + shipper_code + FROM + core.shippers + WHERE + shipper_code LIKE + UPPER(left($1, 3) || '%') + ORDER BY shipper_code desc + LIMIT 1; + + __shipper_code := + UPPER + ( + left($1,3) + ) + || '-' || + CASE + WHEN __shipper_code IS NULL + THEN '0001' + ELSE + to_char(CAST(right(__shipper_code, 4) AS integer)+1,'FM0000') + END; + RETURN __shipper_code; +END; +$$ +LANGUAGE 'plpgsql'; + +CREATE FUNCTION core.update_shipper_code() +RETURNS trigger +AS +$$ +BEGIN + UPDATE core.shippers + SET + shipper_code=core.get_shipper_code(NEW.company_name) + WHERE core.shippers.shipper_id=NEW.shipper_id; + + RETURN NEW; +END +$$ +LANGUAGE plpgsql; + +CREATE TRIGGER update_shipper_code +AFTER INSERT +ON core.shippers +FOR EACH ROW EXECUTE PROCEDURE core.update_shipper_code(); + + +CREATE FUNCTION core.get_account_id_by_shipper_id(integer) +RETURNS integer +AS +$$ +BEGIN + RETURN + ( + SELECT + core.shippers.account_id + FROM + core.shippers + WHERE + core.shippers.shipper_id=$1 + ); +END +$$ +LANGUAGE plpgsql; + + +CREATE TABLE core.tax_types +( + tax_type_id SERIAL NOT NULL PRIMARY KEY, + tax_type_code national character varying(12) NOT NULL, + tax_type_name national character varying(50) NOT NULL, + audit_user_id integer NULL REFERENCES office.users(user_id), + audit_ts TIMESTAMP WITH TIME ZONE NULL DEFAULT(NOW()) +); + +CREATE UNIQUE INDEX tax_types_tax_type_code_uix +ON core.tax_types(UPPER(tax_type_code)); + +CREATE UNIQUE INDEX tax_types_tax_type_name_uix +ON core.tax_types(UPPER(tax_type_name)); + +INSERT INTO core.tax_types(tax_type_code, tax_type_name) +SELECT 'DEF', 'Default'; + +CREATE TABLE core.taxes +( + tax_id SERIAL NOT NULL PRIMARY KEY, + tax_type_id smallint NOT NULL REFERENCES core.tax_types(tax_type_id), + tax_code national character varying(12) NOT NULL, + tax_name national character varying(50) NOT NULL, + rate decimal NOT NULL, + account_id integer NOT NULL REFERENCES core.accounts(account_id), + audit_user_id integer NULL REFERENCES office.users(user_id), + audit_ts TIMESTAMP WITH TIME ZONE NULL DEFAULT(NOW()) +); + + + +CREATE UNIQUE INDEX taxes_tax_code_uix +ON core.taxes(UPPER(tax_code)); + +CREATE UNIQUE INDEX taxes_tax_name_uix +ON core.taxes(UPPER(tax_name)); + +INSERT INTO core.taxes(tax_type_id, tax_code, tax_name, rate, account_id) +SELECT 1, 'VAT', 'Value Added Tax', 13, (SELECT account_id FROM core.accounts WHERE account_name='Sales Tax Payable') UNION ALL +SELECT 1, 'SAT', 'Sales Tax', 5, (SELECT account_id FROM core.accounts WHERE account_name='Sales Tax Payable'); + +CREATE VIEW core.tax_view +AS +SELECT + tax_id, + tax_code, + tax_name, + rate, + tax_type_code, + tax_type_name, + account_code, + account_name +FROM + core.taxes, + core.accounts, + core.tax_types +WHERE + core.taxes.account_id = core.accounts.account_id +AND + core.taxes.tax_type_id = core.tax_types.tax_type_id; + +CREATE TABLE core.item_groups +( + item_group_id SERIAL NOT NULL PRIMARY KEY, + item_group_code national character varying(12) NOT NULL, + item_group_name national character varying(50) NOT NULL, + exclude_from_purchase boolean NOT NULL CONSTRAINT item_groups_exclude_from_purchase_df DEFAULT('No'), + exclude_from_sales boolean NOT NULL CONSTRAINT item_groups_exclude_from_sales_df DEFAULT('No'), + tax_id smallint NOT NULL REFERENCES core.taxes(tax_id), + audit_user_id integer NULL REFERENCES office.users(user_id), + audit_ts TIMESTAMP WITH TIME ZONE NULL DEFAULT(NOW()) +); + + +CREATE UNIQUE INDEX item_groups_item_group_code_uix +ON core.item_groups(UPPER(item_group_code)); + +CREATE UNIQUE INDEX item_groups_item_group_name_uix +ON core.item_groups(UPPER(item_group_name)); + +INSERT INTO core.item_groups(item_group_code, item_group_name, tax_id) +SELECT 'DEF', 'Default', 1; + + +CREATE TABLE core.items +( + item_id SERIAL NOT NULL PRIMARY KEY, + item_code national character varying(12) NOT NULL, + item_name national character varying(150) NOT NULL, + item_group_id integer NOT NULL REFERENCES core.item_groups(item_group_id), + brand_id integer NOT NULL REFERENCES core.brands(brand_id), + preferred_supplier_id integer NULL REFERENCES core.parties(party_id) + CONSTRAINT items_preferred_supplier_id_chk CHECK(core.is_supplier(preferred_supplier_id) = true), + lead_time_in_days integer NOT NULL DEFAULT(0), + unit_id integer NOT NULL REFERENCES core.units(unit_id), + hot_item boolean NOT NULL, + cost_price money_strict NOT NULL, + cost_price_includes_tax boolean NOT NULL CONSTRAINT items_cost_price_includes_tax_df DEFAULT('No'), + selling_price money_strict NOT NULL, + selling_price_includes_tax boolean NOT NULL CONSTRAINT items_selling_price_includes_tax_df DEFAULT('No'), + tax_id integer NOT NULL REFERENCES core.taxes(tax_id), + reorder_level integer NOT NULL, + item_image image_path NULL, + maintain_stock boolean NOT NULL DEFAULT(true), + audit_user_id integer NULL REFERENCES office.users(user_id), + audit_ts TIMESTAMP WITH TIME ZONE NULL DEFAULT(NOW()) +); + +CREATE UNIQUE INDEX items_item_name_uix +ON core.items(UPPER(item_name)); + +CREATE FUNCTION core.get_item_id_by_item_code(text) +RETURNS integer +AS +$$ +BEGIN + RETURN + ( + SELECT + item_id + FROM + core.items + WHERE + core.items.item_code=$1 + ); +END +$$ +LANGUAGE plpgsql; + +CREATE FUNCTION core.get_item_tax_rate(integer) +RETURNS decimal +AS +$$ +BEGIN + RETURN + COALESCE(( + SELECT core.taxes.rate + FROM core.taxes + INNER JOIN core.items + ON core.taxes.tax_id = core.items.tax_id + WHERE core.items.item_id=$1 + ), 0); +END +$$ +LANGUAGE plpgsql; + +--TODO +CREATE VIEW core.item_view +AS +SELECT * FROM core.items; + + +/******************************************************************* + PLEASE NOTE : + + THESE ARE THE MOST EFFECTIVE STOCK ITEM PRICES. + THE PRICE IN THIS CATALOG IS ACTUALLY + PICKED UP AT THE TIME OF PURCHASE AND SALES. + + A STOCK ITEM PRICE MAY BE DIFFERENT FOR DIFFERENT units. + FURTHER, A STOCK ITEM WOULD BE SOLD AT A HIGHER PRICE + WHEN SOLD LOOSE THAN WHAT IT WOULD ACTUALLY COST IN A + COMPOUND UNIT. + + EXAMPLE, ONE CARTOON (20 BOTTLES) OF BEER BOUGHT AS A UNIT + WOULD COST 25% LESS FROM THE SAME STORE. + +*******************************************************************/ + +CREATE TABLE core.item_selling_prices +( + item_selling_price_id BIGSERIAL NOT NULL PRIMARY KEY, + item_id integer NOT NULL REFERENCES core.items(item_id), + unit_id integer NOT NULL REFERENCES core.units(unit_id), + party_type_id smallint NULL REFERENCES core.party_types(party_type_id), + price_type_id smallint NULL REFERENCES core.price_types(price_type_id), + includes_tax boolean NOT NULL CONSTRAINT item_selling_prices_includes_tax_df DEFAULT('No'), + price money_strict NOT NULL, + audit_user_id integer NULL REFERENCES office.users(user_id), + audit_ts TIMESTAMP WITH TIME ZONE NULL DEFAULT(NOW()) +); + + +CREATE VIEW core.item_selling_price_view +AS +SELECT + core.item_selling_prices.item_selling_price_id, + core.items.item_code, + core.items.item_name, + core.party_types.party_type_code, + core.party_types.party_type_name, + price +FROM + core.item_selling_prices +INNER JOIN core.items +ON + core.item_selling_prices.item_id = core.items.item_id +LEFT JOIN + core.price_types +ON + core.item_selling_prices.price_type_id = core.price_types.price_type_id +LEFT JOIN + core.party_types +ON core.item_selling_prices.party_type_id = core.party_types.party_type_id; + + + +CREATE TABLE core.item_cost_prices +( + item_cost_price_id BIGSERIAL NOT NULL PRIMARY KEY, + item_id integer NOT NULL REFERENCES core.items(item_id), + entry_ts TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT(now()), + unit_id integer NOT NULL REFERENCES core.units(unit_id), + party_id bigint NULL REFERENCES core.parties(party_id), + lead_time_in_days integer NOT NULL DEFAULT(0), + includes_tax boolean NOT NULL CONSTRAINT item_cost_prices_includes_tax_df DEFAULT('No'), + price money_strict NOT NULL, + audit_user_id integer NULL REFERENCES office.users(user_id), + audit_ts TIMESTAMP WITH TIME ZONE NULL DEFAULT(NOW()) +); + + +CREATE VIEW core.item_cost_price_view +AS +SELECT + core.item_cost_prices.item_cost_price_id, + core.items.item_code, + core.items.item_name, + core.parties.party_code, + core.parties.party_name, + core.item_cost_prices.price +FROM +core.item_cost_prices +INNER JOIN +core.items +ON core.item_cost_prices.item_id = core.items.item_id +LEFT JOIN +core.parties +ON core.item_cost_prices.party_id = core.parties.party_id; + +CREATE FUNCTION core.get_item_cost_price(item_id_ integer, unit_id_ integer, party_id_ bigint) +RETURNS money +AS +$$ + DECLARE _price money; + DECLARE _unit_id integer; + DECLARE _factor decimal; + DECLARE _tax_rate decimal; + DECLARE _includes_tax boolean; + DECLARE _tax money; +BEGIN + --Fist pick the catalog price which matches all these fields: + --Item, Unit, and Supplier. + --This is the most effective price. + SELECT + item_cost_prices.price, + item_cost_prices.unit_id, + item_cost_prices.includes_tax + INTO + _price, + _unit_id, + _includes_tax + FROM core.item_cost_prices + WHERE item_cost_prices.item_id = $1 + AND item_cost_prices.unit_id = $2 + AND item_cost_prices.party_id =$3; + + IF(_unit_id IS NULL) THEN + --We do not have a cost price of this item for the unit supplied. + --Let's see if this item has a price for other units. + SELECT + item_cost_prices.price, + item_cost_prices.unit_id, + item_cost_prices.includes_tax + INTO + _price, + _unit_id, + _includes_tax + FROM core.item_cost_prices + WHERE item_cost_prices.item_id=$1 + AND item_cost_prices.party_id =$3; + END IF; + + + IF(_price IS NULL) THEN + --This item does not have cost price defined in the catalog. + --Therefore, getting the default cost price from the item definition. + SELECT + cost_price, + unit_id, + cost_price_includes_tax + INTO + _price, + _unit_id, + _includes_tax + FROM core.items + WHERE core.items.item_id = $1; + END IF; + + IF(_includes_tax) THEN + _tax_rate := core.get_item_tax_rate($1); + _price := _price / ((100 + _tax_rate)/ 100); + END IF; + + --Get the unitary conversion factor if the requested unit does not match with the price defition. + _factor := core.convert_unit($2, _unit_id); + + RETURN _price * _factor; +END +$$ +LANGUAGE plpgsql; + + +CREATE TABLE office.store_types +( + store_type_id SERIAL NOT NULL PRIMARY KEY, + store_type_code national character varying(12) NOT NULL, + store_type_name national character varying(50) NOT NULL, + audit_user_id integer NULL REFERENCES office.users(user_id), + audit_ts TIMESTAMP WITH TIME ZONE NULL DEFAULT(NOW()) +); + +CREATE UNIQUE INDEX store_types_Code_uix +ON office.store_types(UPPER(store_type_code)); + + +CREATE UNIQUE INDEX store_types_Name_uix +ON office.store_types(UPPER(store_type_name)); + +INSERT INTO office.store_types(store_type_code,store_type_name) +SELECT 'GOD', 'Godown' UNION ALL +SELECT 'SAL', 'Sales Center' UNION ALL +SELECT 'WAR', 'Warehouse' UNION ALL +SELECT 'PRO', 'Production'; + + +CREATE TABLE office.stores +( + store_id SERIAL NOT NULL PRIMARY KEY, + office_id integer NOT NULL REFERENCES office.offices(office_id), + store_code national character varying(12) NOT NULL, + store_name national character varying(50) NOT NULL, + address national character varying(50) NULL, + store_type_id integer NOT NULL REFERENCES office.store_types(store_type_id), + allow_sales boolean NOT NULL DEFAULT(true), + audit_user_id integer NULL REFERENCES office.users(user_id), + audit_ts TIMESTAMP WITH TIME ZONE NULL DEFAULT(NOW()) +); + + +CREATE UNIQUE INDEX stores_store_code_uix +ON office.stores(UPPER(store_code)); + +CREATE UNIQUE INDEX stores_store_name_uix +ON office.stores(UPPER(store_name)); + + +--TODO +CREATE VIEW office.store_view +AS +SELECT * FROM office.stores; + + +CREATE TABLE office.cash_repositories +( + cash_repository_id BIGSERIAL NOT NULL PRIMARY KEY, + office_id integer NOT NULL REFERENCES office.offices(office_id), + cash_repository_code national character varying(12) NOT NULL, + cash_repository_name national character varying(50) NOT NULL, + parent_cash_repository_id integer NULL REFERENCES office.cash_repositories(cash_repository_id), + description national character varying(100) NULL, + audit_user_id integer NULL REFERENCES office.users(user_id), + audit_ts TIMESTAMP WITH TIME ZONE NULL DEFAULT(NOW()) +); + + +CREATE UNIQUE INDEX cash_repositories_cash_repository_code_uix +ON office.cash_repositories(UPPER(cash_repository_code)); + +CREATE UNIQUE INDEX cash_repositories_cash_repository_name_uix +ON office.cash_repositories(UPPER(cash_repository_name)); + +CREATE FUNCTION office.get_cash_repository_id_by_cash_repository_code(text) +RETURNS integer +AS +$$ +BEGIN + RETURN + ( + SELECT cash_repository_id + FROM office.cash_repositories + WHERE cash_repository_code=$1 + ); +END +$$ +LANGUAGE plpgsql; + +CREATE FUNCTION office.get_cash_repository_id_by_cash_repository_name(text) +RETURNS integer +AS +$$ +BEGIN + RETURN + ( + SELECT cash_repository_id + FROM office.cash_repositories + WHERE cash_repository_name=$1 + ); +END +$$ +LANGUAGE plpgsql; + + + +CREATE VIEW office.cash_repository_view +AS +SELECT + office.cash_repositories.cash_repository_id, + office.cash_repositories.cash_repository_code, + office.cash_repositories.cash_repository_name, + parent_cash_repositories.cash_repository_code parent_cr_code, + parent_cash_repositories.cash_repository_name parent_cr_name, + office.cash_repositories.description +FROM + office.cash_repositories +LEFT OUTER JOIN + office.cash_repositories AS parent_cash_repositories +ON + office.cash_repositories.parent_cash_repository_id=parent_cash_repositories.cash_repository_id; + +CREATE TABLE office.counters +( + counter_id SERIAL NOT NULL PRIMARY KEY, + store_id smallint NOT NULL REFERENCES office.stores(store_id), + cash_repository_id integer NOT NULL REFERENCES office.cash_repositories(cash_repository_id), + counter_code national character varying(12) NOT NULL, + counter_name national character varying(50) NOT NULL, + audit_user_id integer NULL REFERENCES office.users(user_id), + audit_ts TIMESTAMP WITH TIME ZONE NULL DEFAULT(NOW()) +); + + +CREATE UNIQUE INDEX counters_counter_code_uix +ON office.counters(UPPER(counter_code)); + +CREATE UNIQUE INDEX counters_counter_name_uix +ON office.counters(UPPER(counter_name)); + + +CREATE TABLE office.cost_centers +( + cost_center_id SERIAL NOT NULL PRIMARY KEY, + cost_center_code national character varying(24) NOT NULL, + cost_center_name national character varying(50) NOT NULL, + audit_user_id integer NULL REFERENCES office.users(user_id), + audit_ts TIMESTAMP WITH TIME ZONE NULL DEFAULT(NOW()) +); + +CREATE UNIQUE INDEX cost_centers_cost_center_code_uix +ON office.cost_centers(UPPER(cost_center_code)); + +CREATE UNIQUE INDEX cost_centers_cost_center_name_uix +ON office.cost_centers(UPPER(cost_center_name)); + +INSERT INTO office.cost_centers(cost_center_code, cost_center_name) +SELECT 'DEF', 'Default' UNION ALL +SELECT 'GEN', 'General Administration' UNION ALL +SELECT 'HUM', 'Human Resources' UNION ALL +SELECT 'SCC', 'Support & Customer Care' UNION ALL +SELECT 'GAE', 'Guest Accomodation & Entertainment' UNION ALL +SELECT 'MKT', 'Marketing & Promotion' UNION ALL +SELECT 'SAL', 'Sales & Billing' UNION ALL +SELECT 'FIN', 'Finance & Accounting'; + +CREATE VIEW office.cost_center_view +AS +SELECT + office.cost_centers.cost_center_id, + office.cost_centers.cost_center_code, + office.cost_centers.cost_center_name +FROM + office.cost_centers; + + +CREATE TABLE office.cashiers +( + cashier_id BIGSERIAL NOT NULL PRIMARY KEY, + counter_id integer NOT NULL REFERENCES office.counters(counter_id), + user_id integer NOT NULL REFERENCES office.users(user_id), + assigned_by_user_id integer NOT NULL REFERENCES office.users(user_id), + transaction_date date NOT NULL, + closed boolean NOT NULL +); + +CREATE UNIQUE INDEX Cashiers_user_id_TDate_uix +ON office.cashiers(user_id ASC, transaction_date DESC); + + +/******************************************************************* + STORE policy DEFINES THE RIGHT OF USERS TO ACCESS A STORE. + AN ADMINISTRATOR CAN ACCESS ALL THE stores, BY DEFAULT. +*******************************************************************/ + + +CREATE TABLE policy.store_policies +( + store_policy_id BIGSERIAL NOT NULL PRIMARY KEY, + written_by_user_id integer NOT NULL REFERENCES office.users(user_id), + status boolean NOT NULL, + audit_user_id integer NULL REFERENCES office.users(user_id), + audit_ts TIMESTAMP WITH TIME ZONE NULL DEFAULT(NOW()) +); + +CREATE TABLE policy.store_policy_details +( + store_policy_detail_id BIGSERIAL NOT NULL PRIMARY KEY, + store_policy_id integer NOT NULL REFERENCES policy.store_policies(store_policy_id), + user_id integer NOT NULL REFERENCES office.users(user_id), + store_id smallint NOT NULL REFERENCES office.stores(store_id), + audit_user_id integer NULL REFERENCES office.users(user_id), + audit_ts TIMESTAMP WITH TIME ZONE NULL DEFAULT(NOW()) +); + +CREATE TABLE core.item_opening_inventory +( + item_opening_inventory_id BIGSERIAL NOT NULL PRIMARY KEY, + entry_ts TIMESTAMP WITH TIME ZONE NOT NULL, + item_id integer NOT NULL REFERENCES core.items(item_id), + store_id smallint NOT NULL REFERENCES office.stores(store_id), + unit_id integer NOT NULL REFERENCES core.units(unit_id), + quantity integer NOT NULL, + amount money_strict NOT NULL, + base_unit_id integer NOT NULL REFERENCES core.units(unit_id), + base_quantity decimal NOT NULL, + audit_user_id integer NULL REFERENCES office.users(user_id), + audit_ts TIMESTAMP WITH TIME ZONE NULL DEFAULT(NOW()) +); + + +CREATE TABLE audit.history +( + activity_id BIGSERIAL NOT NULL PRIMARY KEY, + event_ts TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT(NOW()), + principal_user national character varying(50) NOT NULL DEFAULT(current_user), + user_id integer /*NOT*/ NULL REFERENCES office.users(user_id), + type national character varying(50) NOT NULL, + table_schema national character varying(50) NOT NULL, + table_name national character varying(50) NOT NULL, + primary_key_id national character varying(50) NOT NULL, + column_name national character varying(50) NOT NULL, + old_val text NULL, + new_val text NULL, + CONSTRAINT audit_history_val_chk + CHECK + ( + (old_val IS NULL AND new_val IS NOT NULL) OR + (old_val IS NOT NULL AND new_val IS NULL) OR + (old_val IS NOT NULL AND new_val IS NOT NULL) + ) +); + + +CREATE FUNCTION office.is_sys_user(integer) +RETURNS boolean +AS +$$ +BEGIN + IF EXISTS + ( + SELECT * FROM office.users + WHERE user_id=$1 + AND role_id IN + ( + SELECT office.roles.role_id FROM office.roles WHERE office.roles.role_code='SYST' + ) + ) THEN + RETURN true; + END IF; + + RETURN false; +END +$$ +LANGUAGE plpgsql; + + +/******************************************************************* + THIS FUNCTION RETURNS A NEW INCREMENTAL COUNTER SUBJECT + TO BE USED TO GENERATE TRANSACTION CODES +*******************************************************************/ + +CREATE FUNCTION transactions.get_new_transaction_counter(date) +RETURNS integer +AS +$$ + DECLARE _ret_val integer; +BEGIN + SELECT INTO _ret_val + COALESCE(MAX(transaction_counter),0) + FROM transactions.transaction_master + WHERE value_date=$1; + + IF _ret_val IS NULL THEN + RETURN 1::integer; + ELSE + RETURN (_ret_val + 1)::integer; + END IF; +END; +$$ +LANGUAGE plpgsql; + +CREATE FUNCTION transactions.get_transaction_code(value_date date, office_id integer, user_id integer, login_id bigint) +RETURNS text +AS +$$ + DECLARE _office_id bigint:=$2; + DECLARE _user_id integer:=$3; + DECLARE _login_id bigint:=$4; + DECLARE _ret_val text; +BEGIN + _ret_val:= transactions.get_new_transaction_counter($1)::text || '-' || TO_CHAR($1, 'YYYY-MM-DD') || '-' || CAST(_office_id as text) || '-' || CAST(_user_id as text) || '-' || CAST(_login_id as text) || '-' || TO_CHAR(now(), 'HH24-MI-SS'); + RETURN _ret_val; +END +$$ +LANGUAGE plpgsql; + + +CREATE TABLE transactions.transaction_master +( + transaction_master_id BIGSERIAL NOT NULL PRIMARY KEY, + transaction_counter integer NOT NULL, --Sequence of transactions of a date + transaction_code national character varying(50) NOT NULL, + book national character varying(50) NOT NULL, --Transaction book. Ex. Sales, Purchase, Journal + value_date date NOT NULL, + transaction_ts TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT(now()), + login_id bigint NOT NULL REFERENCES audit.logins(login_id), + user_id integer NOT NULL REFERENCES office.users(user_id), + sys_user_id integer NULL REFERENCES office.users(user_id) + CONSTRAINT transaction_master_sys_user_id_chk CHECK(sys_user_id IS NULL OR office.is_sys_user(sys_user_id)=true), + office_id integer NOT NULL REFERENCES office.offices(office_id), + cost_center_id integer NULL REFERENCES office.cost_centers(cost_center_id), + reference_number national character varying(24) NULL, + statement_reference text NULL, + last_verified_on TIMESTAMP WITH TIME ZONE NULL, + verified_by_user_id integer NULL REFERENCES office.users(user_id), + verification_status_id smallint NOT NULL REFERENCES core.verification_statuses(verification_status_id) DEFAULT(0/*Awaiting verification*/), + verification_reason national character varying(128) NOT NULL CONSTRAINT transaction_master_verification_reason_df DEFAULT(''), + audit_user_id integer NULL REFERENCES office.users(user_id), + audit_ts TIMESTAMP WITH TIME ZONE NULL DEFAULT(NOW()), + CONSTRAINT transaction_master_login_id_sys_user_id_chk + CHECK + ( + ( + login_id IS NULL AND sys_user_id IS NOT NULL + ) + + OR + + ( + login_id IS NOT NULL AND sys_user_id IS NULL + ) + ) +); + +CREATE UNIQUE INDEX transaction_master_transaction_code_uix +ON transactions.transaction_master(UPPER(transaction_code)); + + + +CREATE TABLE transactions.transaction_details +( + transaction_detail_id BIGSERIAL NOT NULL PRIMARY KEY, + transaction_master_id bigint NOT NULL REFERENCES transactions.transaction_master(transaction_master_id), + tran_type transaction_type NOT NULL, + account_id integer NOT NULL REFERENCES core.accounts(account_id), + statement_reference text NULL, + cash_repository_id integer NULL REFERENCES office.cash_repositories(cash_repository_id), + amount money_strict NOT NULL, + audit_user_id integer NULL REFERENCES office.users(user_id), + audit_ts TIMESTAMP WITH TIME ZONE NULL DEFAULT(NOW()) +); + +CREATE TABLE transactions.stock_master +( + stock_master_id BIGSERIAL NOT NULL PRIMARY KEY, + transaction_master_id bigint NOT NULL REFERENCES transactions.transaction_master(transaction_master_id), + party_id bigint NULL REFERENCES core.parties(party_id), + agent_id integer NULL REFERENCES core.agents(agent_id), + price_type_id integer NULL REFERENCES core.price_types(price_type_id), + is_credit boolean NOT NULL CONSTRAINT stock_master_is_credit_df DEFAULT(false), + shipper_id integer NULL REFERENCES core.shippers(shipper_id), + shipping_address_id integer NULL REFERENCES core.shipping_addresses(shipping_address_id), + shipping_charge money NOT NULL CONSTRAINT stock_master_shipping_charge_df DEFAULT(0), + store_id integer NULL REFERENCES office.stores(store_id), + cash_repository_id integer NULL REFERENCES office.cash_repositories(cash_repository_id), + audit_user_id integer NULL REFERENCES office.users(user_id), + audit_ts TIMESTAMP WITH TIME ZONE NULL DEFAULT(NOW()) +); + + +CREATE TABLE transactions.stock_details +( + stock_master_detail_id BIGSERIAL NOT NULL PRIMARY KEY, + stock_master_id bigint NOT NULL REFERENCES transactions.stock_master(stock_master_id), + tran_type transaction_type NOT NULL, + store_id integer NULL REFERENCES office.stores(store_id), + item_id integer NOT NULL REFERENCES core.items(item_id), + quantity integer NOT NULL, + unit_id integer NOT NULL REFERENCES core.units(unit_id), + base_quantity decimal NOT NULL, + base_unit_id integer NOT NULL REFERENCES core.units(unit_id), + price money_strict NOT NULL, + discount money NOT NULL CONSTRAINT stock_details_discount_df DEFAULT(0), + tax_rate decimal NOT NULL CONSTRAINT stock_details_tax_rate_df DEFAULT(0), + tax money NOT NULL CONSTRAINT stock_details_tax_df DEFAULT(0), + audit_user_id integer NULL REFERENCES office.users(user_id), + audit_ts TIMESTAMP WITH TIME ZONE NULL DEFAULT(NOW()) +); + +CREATE MATERIALIZED VIEW transactions.trial_balance_view +AS +SELECT core.get_account_name(account_id), + SUM(CASE transactions.transaction_details.tran_type WHEN 'Dr' THEN amount ELSE NULL END) AS debit, + SUM(CASE transactions.transaction_details.tran_type WHEN 'Cr' THEN amount ELSE NULL END) AS Credit +FROM transactions.transaction_details +GROUP BY account_id; + + +--TODO +CREATE TABLE transactions.non_gl_stock_master +( + non_gl_stock_master_id BIGSERIAL NOT NULL PRIMARY KEY, + value_date date NOT NULL, + book national character varying(48) NOT NULL, + party_id bigint NULL REFERENCES core.parties(party_id), + price_type_id integer NULL REFERENCES core.price_types(price_type_id), + transaction_ts TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT(now()), + login_id bigint NOT NULL REFERENCES audit.logins(login_id), + user_id integer NOT NULL REFERENCES office.users(user_id), + office_id integer NOT NULL REFERENCES office.offices(office_id), + reference_number national character varying(24) NULL, + statement_reference text NULL, + audit_user_id integer NULL REFERENCES office.users(user_id), + audit_ts TIMESTAMP WITH TIME ZONE NULL DEFAULT(NOW()) +); + + +CREATE TABLE transactions.non_gl_stock_details +( + non_gl_stock_details_id BIGSERIAL NOT NULL PRIMARY KEY, + non_gl_stock_master_id bigint NOT NULL REFERENCES transactions.non_gl_stock_master(non_gl_stock_master_id), + item_id integer NOT NULL REFERENCES core.items(item_id), + quantity integer NOT NULL, + unit_id integer NOT NULL REFERENCES core.units(unit_id), + base_quantity decimal NOT NULL, + base_unit_id integer NOT NULL REFERENCES core.units(unit_id), + price money_strict NOT NULL, + discount money NOT NULL CONSTRAINT non_gl_stock_details_discount_df DEFAULT(0), + tax_rate decimal NOT NULL CONSTRAINT non_gl_stock_details_tax_rate_df DEFAULT(0), + tax money NOT NULL CONSTRAINT non_gl_stock_details_tax_df DEFAULT(0), + audit_user_id integer NULL REFERENCES office.users(user_id), + audit_ts TIMESTAMP WITH TIME ZONE NULL DEFAULT(NOW()) +); + + +CREATE TABLE crm.lead_sources +( + lead_source_id SERIAL NOT NULL PRIMARY KEY, + lead_source_code national character varying(12) NOT NULL, + lead_source_name national character varying(128) NOT NULL, + audit_user_id integer NULL REFERENCES office.users(user_id), + audit_ts TIMESTAMP WITH TIME ZONE NULL DEFAULT(NOW()) +); + +CREATE UNIQUE INDEX lead_sources_lead_source_code_uix +ON crm.lead_sources(UPPER(lead_source_code)); + + +CREATE UNIQUE INDEX lead_sources_lead_source_name_uix +ON crm.lead_sources(UPPER(lead_source_name)); + +INSERT INTO crm.lead_sources(lead_source_code, lead_source_name) +SELECT 'AG', 'Agent' UNION ALL +SELECT 'CC', 'Cold Call' UNION ALL +SELECT 'CR', 'Customer Reference' UNION ALL +SELECT 'DI', 'Direct Inquiry' UNION ALL +SELECT 'EV', 'Events' UNION ALL +SELECT 'PR', 'Partner'; + +CREATE TABLE crm.lead_statuses +( + lead_status_id SERIAL NOT NULL PRIMARY KEY, + lead_status_code national character varying(12) NOT NULL, + lead_status_name national character varying(128) NOT NULL, + audit_user_id integer NULL REFERENCES office.users(user_id), + audit_ts TIMESTAMP WITH TIME ZONE NULL DEFAULT(NOW()) +); + +CREATE UNIQUE INDEX lead_statuses_lead_status_code_uix +ON crm.lead_statuses(UPPER(lead_status_code)); + + +CREATE UNIQUE INDEX lead_statuses_lead_status_name_uix +ON crm.lead_statuses(UPPER(lead_status_name)); + +INSERT INTO crm.lead_statuses(lead_status_code, lead_status_name) +SELECT 'CL', 'Cool' UNION ALL +SELECT 'CF', 'Contact in Future' UNION ALL +SELECT 'LO', 'Lost' UNION ALL +SELECT 'IP', 'In Prgress' UNION ALL +SELECT 'QF', 'Qualified'; + +CREATE TABLE crm.opportunity_stages +( + opportunity_stage_id SERIAL NOT NULL PRIMARY KEY, + opportunity_stage_code national character varying(12) NOT NULL, + opportunity_stage_name national character varying(50) NOT NULL, + audit_user_id integer NULL REFERENCES office.users(user_id), + audit_ts TIMESTAMP WITH TIME ZONE NULL DEFAULT(NOW()) +); + + +CREATE UNIQUE INDEX opportunity_stages_opportunity_stage_code_uix +ON crm.opportunity_stages(UPPER(opportunity_stage_code)); + +CREATE UNIQUE INDEX opportunity_stages_opportunity_stage_name_uix +ON crm.opportunity_stages(UPPER(opportunity_stage_name)); + + +INSERT INTO crm.opportunity_stages(opportunity_stage_code, opportunity_stage_name) +SELECT 'PRO', 'Prospecting' UNION ALL +SELECT 'QUA', 'Qualification' UNION ALL +SELECT 'NEG', 'Negotiating' UNION ALL +SELECT 'VER', 'Verbal' UNION ALL +SELECT 'CLW', 'Closed Won' UNION ALL +SELECT 'CLL', 'Closed Lost'; + +CREATE FUNCTION transactions.get_invoice_amount(transaction_master_id_ bigint) +RETURNS money +AS +$$ +DECLARE _shipping_charge money; +DECLARE _stock_total money; +BEGIN + SELECT SUM((quantity * price) + tax - discount) INTO _stock_total + FROM transactions.stock_details + WHERE transactions.stock_details.stock_master_id = + ( + SELECT transactions.stock_master.stock_master_id + FROM transactions.stock_master WHERE transactions.stock_master.transaction_master_id= $1 + ); + + SELECT shipping_charge INTO _shipping_charge + FROM transactions.stock_master + WHERE transactions.stock_master.transaction_master_id=$1; + + RETURN COALESCE(_stock_total + _shipping_charge, 0::money); +END +$$ +LANGUAGE plpgsql; + +CREATE FUNCTION core.count_item_in_stock(item_id_ integer, unit_id_ integer, store_id_ integer) +RETURNS decimal +AS +$$ + DECLARE _base_unit_id integer; + DECLARE _debit decimal; + DECLARE _credit decimal; + DECLARE _balance decimal; + DECLARE _factor decimal; +BEGIN + + --Get the base item unit + SELECT + core.get_root_unit_id(core.items.unit_id) + INTO _base_unit_id + FROM core.items + WHERE core.items.item_id=$1; + + --Get the sum of debit stock quantity from approved transactions + SELECT + COALESCE(SUM(base_quantity), 0) + INTO _debit + FROM transactions.stock_details + INNER JOIN transactions.stock_master + ON transactions.stock_master.stock_master_id = transactions.stock_details.stock_master_id + INNER JOIN transactions.transaction_master + ON transactions.stock_master.transaction_master_id = transactions.transaction_master.transaction_master_id + WHERE transactions.transaction_master.verification_status_id > 0 + AND transactions.stock_details.item_id=$1 + AND transactions.stock_details.store_id=$3 + AND transactions.stock_details.tran_type='Dr'; + + --Get the sum of credit stock quantity from approved transactions + SELECT + COALESCE(SUM(base_quantity), 0) + INTO _credit + FROM transactions.stock_details + INNER JOIN transactions.stock_master + ON transactions.stock_master.stock_master_id = transactions.stock_details.stock_master_id + INNER JOIN transactions.transaction_master + ON transactions.stock_master.transaction_master_id = transactions.transaction_master.transaction_master_id + WHERE transactions.transaction_master.verification_status_id > 0 + AND transactions.stock_details.item_id=$1 + AND transactions.stock_details.store_id=$3 + AND transactions.stock_details.tran_type='Cr'; + + _balance:= _debit - _credit; + + + _factor = core.convert_unit($2, _base_unit_id); + + return _balance / _factor; +END +$$ +LANGUAGE plpgsql; + +CREATE TABLE core.switch_categories +( + switch_category_id SERIAL NOT NULL PRIMARY KEY, + switch_category_name national character varying(128) NOT NULL, + audit_user_id integer NULL REFERENCES office.users(user_id), + audit_ts TIMESTAMP WITH TIME ZONE NULL DEFAULT(NOW()) +); + +CREATE UNIQUE INDEX switch_categories_switch_category_name_uix +ON core.switch_categories(UPPER(switch_category_name)); + +INSERT INTO core.switch_categories(switch_category_name) +SELECT 'General'; + +CREATE FUNCTION core.get_switch_category_id_by_name(text) +RETURNS integer +AS +$$ +BEGIN + RETURN + ( + SELECT switch_category_id + FROM core.switch_categories + WHERE core.switch_categories.switch_category_name=$1 + ); +END +$$ +LANGUAGE plpgsql; + +CREATE TABLE office.work_centers +( + work_center_id SERIAL NOT NULL PRIMARY KEY, + office_id integer NOT NULL REFERENCES office.offices(office_id), + work_center_code national character varying(12) NOT NULL, + work_center_name national character varying(128) NOT NULL, + audit_user_id integer NULL REFERENCES office.users(user_id), + audit_ts TIMESTAMP WITH TIME ZONE NULL DEFAULT(NOW()) +); + +CREATE UNIQUE INDEX work_centers_work_center_code_uix +ON office.work_centers(UPPER(work_center_code)); + +CREATE UNIQUE INDEX work_centers_work_center_name_uix +ON office.work_centers(UPPER(work_center_name)); + +CREATE VIEW office.work_center_view +AS +SELECT + office.work_centers.work_center_id, + office.offices.office_code || ' (' || office.offices.office_name || ')' AS office, + office.work_centers.work_center_code, + office.work_centers.work_center_name +FROM office.work_centers +INNER JOIN office.offices +ON office.work_centers.office_id = office.offices.office_id; + + + +CREATE FUNCTION office.is_admin(integer) +RETURNS boolean +AS +$$ +BEGIN + RETURN + ( + SELECT office.roles.is_admin FROM office.users + INNER JOIN office.roles + ON office.users.role_id = office.roles.role_id + WHERE office.users.user_id=$1 + ); +END +$$ +LANGUAGE PLPGSQL; + + +CREATE FUNCTION office.is_sys(integer) +RETURNS boolean +AS +$$ +BEGIN + RETURN + ( + SELECT office.roles.is_system FROM office.users + INNER JOIN office.roles + ON office.users.role_id = office.roles.role_id + WHERE office.users.user_id=$1 + ); +END +$$ +LANGUAGE PLPGSQL; + + + +CREATE TABLE policy.voucher_verification_policy +( + user_id integer NOT NULL PRIMARY KEY REFERENCES office.users(user_id), + can_verify_sales_transactions boolean NOT NULL CONSTRAINT voucher_verification_policy_verify_sales_df DEFAULT(false), + sales_verification_limit money NOT NULL CONSTRAINT voucher_verification_policy_sales_verification_limit_df DEFAULT(0), + can_verify_purchase_transactions boolean NOT NULL CONSTRAINT voucher_verification_policy_verify_purchase_df DEFAULT(false), + purchase_verification_limit money NOT NULL CONSTRAINT voucher_verification_policy_purchase_verification_limit_df DEFAULT(0), + can_verify_gl_transactions boolean NOT NULL CONSTRAINT voucher_verification_policy_verify_gl_df DEFAULT(false), + gl_verification_limit money NOT NULL CONSTRAINT voucher_verification_policy_gl_verification_limit_df DEFAULT(0), + can_self_verify boolean NOT NULL CONSTRAINT voucher_verification_policy_verify_self_df DEFAULT(false), + self_verification_limit money NOT NULL CONSTRAINT voucher_verification_policy_self_verification_limit_df DEFAULT(0), + effective_from date NOT NULL, + ends_on date NOT NULL, + is_active boolean NOT NULL, + audit_user_id integer NULL REFERENCES office.users(user_id), + audit_ts TIMESTAMP WITH TIME ZONE NULL DEFAULT(NOW()) +); + +CREATE VIEW policy.voucher_verification_policy_view +AS +SELECT + policy.voucher_verification_policy.user_id, + office.users.user_name, + policy.voucher_verification_policy.can_verify_sales_transactions, + policy.voucher_verification_policy.sales_verification_limit, + policy.voucher_verification_policy.can_verify_purchase_transactions, + policy.voucher_verification_policy.purchase_verification_limit, + policy.voucher_verification_policy.can_verify_gl_transactions, + policy.voucher_verification_policy.gl_verification_limit, + policy.voucher_verification_policy.can_self_verify, + policy.voucher_verification_policy.self_verification_limit, + policy.voucher_verification_policy.effective_from, + policy.voucher_verification_policy.ends_on, + policy.voucher_verification_policy.is_active +FROM policy.voucher_verification_policy +INNER JOIN office.users +ON policy.voucher_verification_policy.user_id=office.users.user_id; + +CREATE TABLE policy.auto_verification_policy +( + user_id integer NOT NULL PRIMARY KEY REFERENCES office.users(user_id), + verify_sales_transactions boolean NOT NULL CONSTRAINT auto_verification_policy_verify_sales_df DEFAULT(false), + sales_verification_limit money NOT NULL CONSTRAINT auto_verification_policy_sales_verification_limit_df DEFAULT(0), + verify_purchase_transactions boolean NOT NULL CONSTRAINT auto_verification_policy_verify_purchase_df DEFAULT(false), + purchase_verification_limit money NOT NULL CONSTRAINT auto_verification_policy_purchase_verification_limit_df DEFAULT(0), + verify_gl_transactions boolean NOT NULL CONSTRAINT auto_verification_policy_verify_gl_df DEFAULT(false), + gl_verification_limit money NOT NULL CONSTRAINT auto_verification_policy_gl_verification_limit_df DEFAULT(0), + effective_from date NOT NULL, + ends_on date NOT NULL, + is_active boolean NOT NULL, + audit_user_id integer NULL REFERENCES office.users(user_id), + audit_ts TIMESTAMP WITH TIME ZONE NULL DEFAULT(NOW()) +); + +CREATE VIEW policy.auto_verification_policy_view +AS +SELECT + policy.auto_verification_policy.user_id, + office.users.user_name, + policy.auto_verification_policy.verify_sales_transactions, + policy.auto_verification_policy.sales_verification_limit, + policy.auto_verification_policy.verify_purchase_transactions, + policy.auto_verification_policy.purchase_verification_limit, + policy.auto_verification_policy.verify_gl_transactions, + policy.auto_verification_policy.gl_verification_limit, + policy.auto_verification_policy.effective_from, + policy.auto_verification_policy.ends_on, + policy.auto_verification_policy.is_active +FROM policy.auto_verification_policy +INNER JOIN office.users +ON policy.auto_verification_policy.user_id=office.users.user_id; diff --git a/MixERP.Net.FrontEnd/db/en-US/party-sample.sql b/MixERP.Net.FrontEnd/db/en-US/party-sample.sql new file mode 100644 index 000000000..64ac3b0a2 --- /dev/null +++ b/MixERP.Net.FrontEnd/db/en-US/party-sample.sql @@ -0,0 +1,1096 @@ +/******************************************************************************** +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/. +***********************************************************************************/ +ALTER TABLE core.parties +ADD shipping_address national character varying(250) NULL; + +INSERT INTO core.parties(party_type_id, first_name, last_name, date_of_birth, city, state, country,shipping_address, phone, fax, cell, email, url, pan_number, sst_number, cst_number, allow_credit, maximum_credit_period, maximum_credit_amount, charge_interest, interest_rate, interest_compounding_frequency_id, account_id) +SELECT 4, 'Jacob', 'Smith', '1970-01-01'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741510', '1-5478450', '9812345670', 'jacob_smith@gmail.com', 'www.jacob.com', '5412541', '12457841','4578420','t'::boolean,1,500000,'t'::boolean,5,3,67 UNION ALL +SELECT 1, 'Michael', 'Johnson', '1970-01-02'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741511', '1-5478451', '9812345671', 'michael_johnson@gmail.com', 'www.michael.com', '5412542', '12457842','4578421','t'::boolean,1,500000,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Joshua', 'Williams', '1970-01-03'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741512', '1-5478452', '9812345672', 'joshua_williams@gmail.com', 'www.joshua.com', '5412543', '12457843','4578422','t'::boolean,1,500000,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Matthew', 'Jones', '1970-01-04'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741513', '1-5478453', '9812345673', 'matthew_jones@gmail.com', 'www.matthew.com', '5412544', '12457844','4578423','t'::boolean,1,500000,'t'::boolean,5,3,15 UNION ALL +SELECT 4, 'Ethan', 'Brown', '1970-01-05'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741514', '1-5478454', '9812345674', 'ethan_brown@gmail.com', 'www.ethan.com', '5412545', '12457845','4578424','t'::boolean,1,500000,'t'::boolean,5,3,67 UNION ALL +SELECT 4, 'Andrew', 'Davis', '1970-01-06'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741515', '1-5478455', '9812345675', 'andrew_davis@gmail.com', 'www.andrew.com', '5412546', '12457846','4578425','f'::boolean,0,0,'t'::boolean,5,3,67 UNION ALL +SELECT 1, 'Daniel', 'Miller', '1970-01-07'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741516', '1-5478456', '9812345676', 'daniel_miller@gmail.com', 'www.daniel.com', '5412547', '12457847','4578426','t'::boolean,1,500000,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Anthony', 'Wilson', '1970-01-08'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741517', '1-5478457', '9812345677', 'anthony_wilson@gmail.com', 'www.anthony.com', '5412548', '12457848','4578427','t'::boolean,1,500000,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Christopher', 'Moore', '1970-01-09'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741518', '1-5478458', '9812345678', 'christopher_moore@gmail.com', 'www.christopher.com', '5412549', '12457849','4578428','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Joseph', 'Taylor', '1970-01-10'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741519', '1-5478459', '9812345679', 'joseph_taylor@gmail.com', 'www.joseph.com', '5412550', '12457850','4578429','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'William', 'Anderson', '1970-01-11'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741520', '1-5478460', '9812345680', 'william_anderson@gmail.com', 'www.william.com', '5412551', '12457851','4578430','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Alexander', 'Thomas', '1970-01-12'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741521', '1-5478461', '9812345681', 'alexander_thomas@gmail.com', 'www.alexander.com', '5412552', '12457852','4578431','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Ryan', 'Jackson', '1970-01-13'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741522', '1-5478462', '9812345682', 'ryan_jackson@gmail.com', 'www.ryan.com', '5412553', '12457853','4578432','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'David', 'White', '1970-01-14'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741523', '1-5478463', '9812345683', 'david_white@gmail.com', 'www.david.com', '5412554', '12457854','4578433','t'::boolean,1,500000,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Nicholas', 'Harris', '1970-01-15'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741524', '1-5478464', '9812345684', 'nicholas_harris@gmail.com', 'www.nicholas.com', '5412555', '12457855','4578434','t'::boolean,1,500000,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Tyler', 'Martin', '1970-01-16'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741525', '1-5478465', '9812345685', 'tyler_martin@gmail.com', 'www.tyler.com', '5412556', '12457856','4578435','t'::boolean,1,500000,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'James', 'Thompson', '1970-01-17'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741526', '1-5478466', '9812345686', 'james_thompson@gmail.com', 'www.james.com', '5412557', '12457857','4578436','t'::boolean,1,500000,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'John', 'Garcia', '1970-01-18'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741527', '1-5478467', '9812345687', 'john_garcia@gmail.com', 'www.john.com', '5412558', '12457858','4578437','t'::boolean,1,500000,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Jonathan', 'Martinez', '1970-01-19'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741528', '1-5478468', '9812345688', 'jonathan_martinez@gmail.com', 'www.jonathan.com', '5412559', '12457859','4578438','t'::boolean,1,500000,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Nathan', 'Robinson', '1970-01-20'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741529', '1-5478469', '9812345689', 'nathan_robinson@gmail.com', 'www.nathan.com', '5412560', '12457860','4578439','t'::boolean,1,500000,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Samuel', 'Clark', '1970-01-21'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741530', '1-5478470', '9812345690', 'samuel_clark@gmail.com', 'www.samuel.com', '5412561', '12457861','4578440','t'::boolean,1,500000,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Christian', 'Rodriguez', '1970-01-22'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741531', '1-5478471', '9812345691', 'christian_rodriguez@gmail.com', 'www.christian.com', '5412562', '12457862','4578441','t'::boolean,1,500000,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Noah', 'Lewis', '1970-01-23'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741532', '1-5478472', '9812345692', 'noah_lewis@gmail.com', 'www.noah.com', '5412563', '12457863','4578442','t'::boolean,1,500000,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Dylan', 'Lee', '1970-01-24'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741533', '1-5478473', '9812345693', 'dylan_lee@gmail.com', 'www.dylan.com', '5412564', '12457864','4578443','t'::boolean,1,500000,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Benjamin', 'Walker', '1970-01-25'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741534', '1-5478474', '9812345694', 'benjamin_walker@gmail.com', 'www.benjamin.com', '5412565', '12457865','4578444','t'::boolean,1,500000,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Logan', 'Hall', '1970-01-26'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741535', '1-5478475', '9812345695', 'logan_hall@gmail.com', 'www.logan.com', '5412566', '12457866','4578445','t'::boolean,1,500000,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Brandon', 'Allen', '1970-01-27'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741536', '1-5478476', '9812345696', 'brandon_allen@gmail.com', 'www.brandon.com', '5412567', '12457867','4578446','t'::boolean,1,500000,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Gabriel', 'Young', '1970-01-28'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741537', '1-5478477', '9812345697', 'gabriel_young@gmail.com', 'www.gabriel.com', '5412568', '12457868','4578447','t'::boolean,1,500000,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Zachary', 'Hernandez', '1970-01-29'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741538', '1-5478478', '9812345698', 'zachary_hernandez@gmail.com', 'www.zachary.com', '5412569', '12457869','4578448','t'::boolean,1,500000,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Jose', 'King', '1970-01-30'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741539', '1-5478479', '9812345699', 'jose_king@gmail.com', 'www.jose.com', '5412570', '12457870','4578449','t'::boolean,1,500000,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Elijah', 'Wright', '1970-01-31'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741540', '1-5478480', '9812345700', 'elijah_wright@gmail.com', 'www.elijah.com', '5412571', '12457871','4578450','t'::boolean,1,500000,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Angel', 'Lopez', '1970-02-01'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741541', '1-5478481', '9812345701', 'angel_lopez@gmail.com', 'www.angel.com', '5412572', '12457872','4578451','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Kevin', 'Hill', '1970-02-02'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741542', '1-5478482', '9812345702', 'kevin_hill@gmail.com', 'www.kevin.com', '5412573', '12457873','4578452','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Jack', 'Scott', '1970-02-03'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741543', '1-5478483', '9812345703', 'jack_scott@gmail.com', 'www.jack.com', '5412574', '12457874','4578453','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Caleb', 'Green', '1970-02-04'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741544', '1-5478484', '9812345704', 'caleb_green@gmail.com', 'www.caleb.com', '5412575', '12457875','4578454','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Justin', 'Adams', '1970-02-05'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741545', '1-5478485', '9812345705', 'justin_adams@gmail.com', 'www.justin.com', '5412576', '12457876','4578455','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Austin', 'Baker', '1970-02-06'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741546', '1-5478486', '9812345706', 'austin_baker@gmail.com', 'www.austin.com', '5412577', '12457877','4578456','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Evan', 'Gonzalez', '1970-02-07'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741547', '1-5478487', '9812345707', 'evan_gonzalez@gmail.com', 'www.evan.com', '5412578', '12457878','4578457','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Robert', 'Nelson', '1970-02-08'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741548', '1-5478488', '9812345708', 'robert_nelson@gmail.com', 'www.robert.com', '5412579', '12457879','4578458','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Thomas', 'Carter', '1970-02-09'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741549', '1-5478489', '9812345709', 'thomas_carter@gmail.com', 'www.thomas.com', '5412580', '12457880','4578459','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Luke', 'Mitchell', '1970-02-10'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741550', '1-5478490', '9812345710', 'luke_mitchell@gmail.com', 'www.luke.com', '5412581', '12457881','4578460','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Mason', 'Perez', '1970-02-11'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741551', '1-5478491', '9812345711', 'mason_perez@gmail.com', 'www.mason.com', '5412582', '12457882','4578461','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Aidan', 'Roberts', '1970-02-12'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741552', '1-5478492', '9812345712', 'aidan_roberts@gmail.com', 'www.aidan.com', '5412583', '12457883','4578462','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Jackson', 'Turner', '1970-02-13'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741553', '1-5478493', '9812345713', 'jackson_turner@gmail.com', 'www.jackson.com', '5412584', '12457884','4578463','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Isaiah', 'Phillips', '1970-02-14'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741554', '1-5478494', '9812345714', 'isaiah_phillips@gmail.com', 'www.isaiah.com', '5412585', '12457885','4578464','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Jordan', 'Campbell', '1970-02-15'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741555', '1-5478495', '9812345715', 'jordan_campbell@gmail.com', 'www.jordan.com', '5412586', '12457886','4578465','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Gavin', 'Parker', '1970-02-16'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741556', '1-5478496', '9812345716', 'gavin_parker@gmail.com', 'www.gavin.com', '5412587', '12457887','4578466','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Connor', 'Evans', '1970-02-17'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741557', '1-5478497', '9812345717', 'connor_evans@gmail.com', 'www.connor.com', '5412588', '12457888','4578467','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Aiden', 'Edwards', '1970-02-18'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741558', '1-5478498', '9812345718', 'aiden_edwards@gmail.com', 'www.aiden.com', '5412589', '12457889','4578468','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Isaac', 'Collins', '1970-02-19'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741559', '1-5478499', '9812345719', 'isaac_collins@gmail.com', 'www.isaac.com', '5412590', '12457890','4578469','t'::boolean,1,500000,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Jason', 'Stewart', '1970-02-20'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741560', '1-5478500', '9812345720', 'jason_stewart@gmail.com', 'www.jason.com', '5412591', '12457891','4578470','t'::boolean,1,500000,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Cameron', 'Sanchez', '1970-02-21'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741561', '1-5478501', '9812345721', 'cameron_sanchez@gmail.com', 'www.cameron.com', '5412592', '12457892','4578471','t'::boolean,1,500000,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Hunter', 'Morris', '1970-02-22'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741562', '1-5478502', '9812345722', 'hunter_morris@gmail.com', 'www.hunter.com', '5412593', '12457893','4578472','t'::boolean,1,500000,'t'::boolean,5,3,15 UNION ALL +SELECT 4, 'Jayden', 'Rogers', '1970-02-23'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741563', '1-5478503', '9812345723', 'jayden_rogers@gmail.com', 'www.jayden.com', '5412594', '12457894','4578473','t'::boolean,1,500000,'t'::boolean,5,3,67 UNION ALL +SELECT 1, 'Juan', 'Reed', '1970-02-24'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741564', '1-5478504', '9812345724', 'juan_reed@gmail.com', 'www.juan.com', '5412595', '12457895','4578474','t'::boolean,1,500000,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Charles', 'Cook', '1970-02-25'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741565', '1-5478505', '9812345725', 'charles_cook@gmail.com', 'www.charles.com', '5412596', '12457896','4578475','t'::boolean,1,500000,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Aaron', 'Morgan', '1970-02-26'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741566', '1-5478506', '9812345726', 'aaron_morgan@gmail.com', 'www.aaron.com', '5412597', '12457897','4578476','t'::boolean,1,500000,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Lucas', 'Bell', '1970-02-27'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741567', '1-5478507', '9812345727', 'lucas_bell@gmail.com', 'www.lucas.com', '5412598', '12457898','4578477','t'::boolean,1,500000,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Luis', 'Murphy', '1970-02-28'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741568', '1-5478508', '9812345728', 'luis_murphy@gmail.com', 'www.luis.com', '5412599', '12457899','4578478','t'::boolean,1,500000,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Owen', 'Bailey', '1970-03-01'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741569', '1-5478509', '9812345729', 'owen_bailey@gmail.com', 'www.owen.com', '5412600', '12457900','4578479','t'::boolean,1,500000,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Landon', 'Rivera', '1970-03-02'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741570', '1-5478510', '9812345730', 'landon_rivera@gmail.com', 'www.landon.com', '5412601', '12457901','4578480','t'::boolean,1,500000,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Diego', 'Cooper', '1970-03-03'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741571', '1-5478511', '9812345731', 'diego_cooper@gmail.com', 'www.diego.com', '5412602', '12457902','4578481','t'::boolean,1,500000,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Brian', 'Richardson', '1970-03-04'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741572', '1-5478512', '9812345732', 'brian_richardson@gmail.com', 'www.brian.com', '5412603', '12457903','4578482','t'::boolean,1,500000,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Adam', 'Cox', '1970-03-05'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741573', '1-5478513', '9812345733', 'adam_cox@gmail.com', 'www.adam.com', '5412604', '12457904','4578483','t'::boolean,1,500000,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Adrian', 'Howard', '1970-03-06'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741574', '1-5478514', '9812345734', 'adrian_howard@gmail.com', 'www.adrian.com', '5412605', '12457905','4578484','t'::boolean,1,500000,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Kyle', 'Ward', '1970-03-07'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741575', '1-5478515', '9812345735', 'kyle_ward@gmail.com', 'www.kyle.com', '5412606', '12457906','4578485','t'::boolean,1,500000,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Eric', 'Torres', '1970-03-08'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741576', '1-5478516', '9812345736', 'eric_torres@gmail.com', 'www.eric.com', '5412607', '12457907','4578486','t'::boolean,1,500000,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Ian', 'Peterson', '1970-03-09'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741577', '1-5478517', '9812345737', 'ian_peterson@gmail.com', 'www.ian.com', '5412608', '12457908','4578487','t'::boolean,1,500000,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Nathaniel', 'Gray', '1970-03-10'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741578', '1-5478518', '9812345738', 'nathaniel_gray@gmail.com', 'www.nathaniel.com', '5412609', '12457909','4578488','t'::boolean,1,500000,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Carlos', 'Ramirez', '1970-03-11'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741579', '1-5478519', '9812345739', 'carlos_ramirez@gmail.com', 'www.carlos.com', '5412610', '12457910','4578489','t'::boolean,1,500000,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Alex', 'James', '1970-03-12'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741580', '1-5478520', '9812345740', 'alex_james@gmail.com', 'www.alex.com', '5412611', '12457911','4578490','t'::boolean,1,500000,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Bryan', 'Watson', '1970-03-13'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741581', '1-5478521', '9812345741', 'bryan_watson@gmail.com', 'www.bryan.com', '5412612', '12457912','4578491','t'::boolean,1,500000,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Jesus', 'Brooks', '1970-03-14'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741582', '1-5478522', '9812345742', 'jesus_brooks@gmail.com', 'www.jesus.com', '5412613', '12457913','4578492','t'::boolean,1,500000,'t'::boolean,5,3,15 UNION ALL +SELECT 4, 'Julian', 'Kelly', '1970-03-15'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741583', '1-5478523', '9812345743', 'julian_kelly@gmail.com', 'www.julian.com', '5412614', '12457914','4578493','t'::boolean,1,500000,'t'::boolean,5,3,67 UNION ALL +SELECT 1, 'Sean', 'Sanders', '1970-03-16'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741584', '1-5478524', '9812345744', 'sean_sanders@gmail.com', 'www.sean.com', '5412615', '12457915','4578494','t'::boolean,1,500000,'t'::boolean,5,3,15 UNION ALL +SELECT 4, 'Carter', 'Price', '1970-03-17'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741585', '1-5478525', '9812345745', 'carter_price@gmail.com', 'www.carter.com', '5412616', '12457916','4578495','t'::boolean,1,500000,'t'::boolean,5,3,67 UNION ALL +SELECT 1, 'Hayden', 'Bennett', '1970-03-18'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741586', '1-5478526', '9812345746', 'hayden_bennett@gmail.com', 'www.hayden.com', '5412617', '12457917','4578496','t'::boolean,1,500000,'t'::boolean,5,3,15 UNION ALL +SELECT 4, 'Jeremiah', 'Wood', '1970-03-19'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741587', '1-5478527', '9812345747', 'jeremiah_wood@gmail.com', 'www.jeremiah.com', '5412618', '12457918','4578497','t'::boolean,1,500000,'t'::boolean,5,3,67 UNION ALL +SELECT 1, 'Cole', 'Barnes', '1970-03-20'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741588', '1-5478528', '9812345748', 'cole_barnes@gmail.com', 'www.cole.com', '5412619', '12457919','4578498','t'::boolean,1,500000,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Brayden', 'Ross', '1970-03-21'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741589', '1-5478529', '9812345749', 'brayden_ross@gmail.com', 'www.brayden.com', '5412620', '12457920','4578499','t'::boolean,1,500000,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Wyatt', 'Henderson', '1970-03-22'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741590', '1-5478530', '9812345750', 'wyatt_henderson@gmail.com', 'www.wyatt.com', '5412621', '12457921','4578500','t'::boolean,1,500000,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Chase', 'Coleman', '1970-03-23'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741591', '1-5478531', '9812345751', 'chase_coleman@gmail.com', 'www.chase.com', '5412622', '12457922','4578501','t'::boolean,1,500000,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Steven', 'Jenkins', '1970-03-24'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741592', '1-5478532', '9812345752', 'steven_jenkins@gmail.com', 'www.steven.com', '5412623', '12457923','4578502','t'::boolean,1,500000,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Timothy', 'Perry', '1970-03-25'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741593', '1-5478533', '9812345753', 'timothy_perry@gmail.com', 'www.timothy.com', '5412624', '12457924','4578503','t'::boolean,1,500000,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Dominic', 'Powell', '1970-03-26'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741594', '1-5478534', '9812345754', 'dominic_powell@gmail.com', 'www.dominic.com', '5412625', '12457925','4578504','t'::boolean,1,500000,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Sebastian', 'Long', '1970-03-27'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741595', '1-5478535', '9812345755', 'sebastian_long@gmail.com', 'www.sebastian.com', '5412626', '12457926','4578505','t'::boolean,1,500000,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Xavier', 'Patterson', '1970-03-28'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741596', '1-5478536', '9812345756', 'xavier_patterson@gmail.com', 'www.xavier.com', '5412627', '12457927','4578506','t'::boolean,1,500000,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Jaden', 'Hughes', '1970-03-29'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741597', '1-5478537', '9812345757', 'jaden_hughes@gmail.com', 'www.jaden.com', '5412628', '12457928','4578507','t'::boolean,1,500000,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Jesse', 'Flores', '1970-03-30'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741598', '1-5478538', '9812345758', 'jesse_flores@gmail.com', 'www.jesse.com', '5412629', '12457929','4578508','t'::boolean,1,500000,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Devin', 'Washington', '1970-03-31'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741599', '1-5478539', '9812345759', 'devin_washington@gmail.com', 'www.devin.com', '5412630', '12457930','4578509','t'::boolean,1,500000,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Seth', 'Butler', '1970-04-01'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741600', '1-5478540', '9812345760', 'seth_butler@gmail.com', 'www.seth.com', '5412631', '12457931','4578510','t'::boolean,1,500000,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Antonio', 'Simmons', '1970-04-02'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741601', '1-5478541', '9812345761', 'antonio_simmons@gmail.com', 'www.antonio.com', '5412632', '12457932','4578511','t'::boolean,1,500000,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Richard', 'Foster', '1970-04-03'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741602', '1-5478542', '9812345762', 'richard_foster@gmail.com', 'www.richard.com', '5412633', '12457933','4578512','t'::boolean,1,500000,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Miguel', 'Gonzales', '1970-04-04'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741603', '1-5478543', '9812345763', 'miguel_gonzales@gmail.com', 'www.miguel.com', '5412634', '12457934','4578513','t'::boolean,1,500000,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Colin', 'Bryant', '1970-04-05'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741604', '1-5478544', '9812345764', 'colin_bryant@gmail.com', 'www.colin.com', '5412635', '12457935','4578514','t'::boolean,1,500000,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Cody', 'Alexander', '1970-04-06'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741605', '1-5478545', '9812345765', 'cody_alexander@gmail.com', 'www.cody.com', '5412636', '12457936','4578515','t'::boolean,1,500000,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Alejandro', 'Russell', '1970-04-07'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741606', '1-5478546', '9812345766', 'alejandro_russell@gmail.com', 'www.alejandro.com', '5412637', '12457937','4578516','t'::boolean,1,500000,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Caden', 'Griffin', '1970-04-08'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741607', '1-5478547', '9812345767', 'caden_griffin@gmail.com', 'www.caden.com', '5412638', '12457938','4578517','t'::boolean,1,500000,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Blake', 'Diaz', '1970-04-09'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741608', '1-5478548', '9812345768', 'blake_diaz@gmail.com', 'www.blake.com', '5412639', '12457939','4578518','t'::boolean,1,500000,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Carson', 'Hayes', '1970-04-10'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741609', '1-5478549', '9812345769', 'carson_hayes@gmail.com', 'www.carson.com', '5412640', '12457940','4578519','t'::boolean,1,500000,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Kaden', 'Myers', '1970-04-11'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741610', '1-5478550', '9812345770', 'kaden_myers@gmail.com', 'www.kaden.com', '5412641', '12457941','4578520','t'::boolean,1,500000,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Jake', 'Ford', '1970-04-12'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741611', '1-5478551', '9812345771', 'jake_ford@gmail.com', 'www.jake.com', '5412642', '12457942','4578521','t'::boolean,1,500000,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Henry', 'Hamilton', '1970-04-13'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741612', '1-5478552', '9812345772', 'henry_hamilton@gmail.com', 'www.henry.com', '5412643', '12457943','4578522','t'::boolean,1,500000,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Liam', 'Graham', '1970-04-14'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741613', '1-5478553', '9812345773', 'liam_graham@gmail.com', 'www.liam.com', '5412644', '12457944','4578523','t'::boolean,1,500000,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Victor', 'Sullivan', '1970-04-15'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741614', '1-5478554', '9812345774', 'victor_sullivan@gmail.com', 'www.victor.com', '5412645', '12457945','4578524','t'::boolean,1,500000,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Riley', 'Wallace', '1970-04-16'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741615', '1-5478555', '9812345775', 'riley_wallace@gmail.com', 'www.riley.com', '5412646', '12457946','4578525','t'::boolean,1,500000,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Ashton', 'Woods', '1970-04-17'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741616', '1-5478556', '9812345776', 'ashton_woods@gmail.com', 'www.ashton.com', '5412647', '12457947','4578526','t'::boolean,1,500000,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Patrick', 'Cole', '1970-04-18'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741617', '1-5478557', '9812345777', 'patrick_cole@gmail.com', 'www.patrick.com', '5412648', '12457948','4578527','t'::boolean,1,500000,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Bryce', 'West', '1970-04-19'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741618', '1-5478558', '9812345778', 'bryce_west@gmail.com', 'www.bryce.com', '5412649', '12457949','4578528','t'::boolean,1,500000,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Brady', 'Jordan', '1970-04-20'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741619', '1-5478559', '9812345779', 'brady_jordan@gmail.com', 'www.brady.com', '5412650', '12457950','4578529','t'::boolean,1,500000,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Vincent', 'Owens', '1970-04-21'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741620', '1-5478560', '9812345780', 'vincent_owens@gmail.com', 'www.vincent.com', '5412651', '12457951','4578530','t'::boolean,1,500000,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Trevor', 'Reynolds', '1970-04-22'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741621', '1-5478561', '9812345781', 'trevor_reynolds@gmail.com', 'www.trevor.com', '5412652', '12457952','4578531','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Tristan', 'Fisher', '1970-04-23'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741622', '1-5478562', '9812345782', 'tristan_fisher@gmail.com', 'www.tristan.com', '5412653', '12457953','4578532','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Mark', 'Ellis', '1970-04-24'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741623', '1-5478563', '9812345783', 'mark_ellis@gmail.com', 'www.mark.com', '5412654', '12457954','4578533','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Jeremy', 'Harrison', '1970-04-25'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741624', '1-5478564', '9812345784', 'jeremy_harrison@gmail.com', 'www.jeremy.com', '5412655', '12457955','4578534','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Oscar', 'Gibson', '1970-04-26'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741625', '1-5478565', '9812345785', 'oscar_gibson@gmail.com', 'www.oscar.com', '5412656', '12457956','4578535','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Marcus', 'Mcdonald', '1970-04-27'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741626', '1-5478566', '9812345786', 'marcus_mcdonald@gmail.com', 'www.marcus.com', '5412657', '12457957','4578536','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Jorge', 'Cruz', '1970-04-28'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741627', '1-5478567', '9812345787', 'jorge_cruz@gmail.com', 'www.jorge.com', '5412658', '12457958','4578537','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Parker', 'Marshall', '1970-04-29'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741628', '1-5478568', '9812345788', 'parker_marshall@gmail.com', 'www.parker.com', '5412659', '12457959','4578538','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Kaleb', 'Ortiz', '1970-04-30'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741629', '1-5478569', '9812345789', 'kaleb_ortiz@gmail.com', 'www.kaleb.com', '5412660', '12457960','4578539','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Cooper', 'Gomez', '1970-05-01'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741630', '1-5478570', '9812345790', 'cooper_gomez@gmail.com', 'www.cooper.com', '5412661', '12457961','4578540','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Kenneth', 'Murray', '1970-05-02'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741631', '1-5478571', '9812345791', 'kenneth_murray@gmail.com', 'www.kenneth.com', '5412662', '12457962','4578541','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Garrett', 'Freeman', '1970-05-03'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741632', '1-5478572', '9812345792', 'garrett_freeman@gmail.com', 'www.garrett.com', '5412663', '12457963','4578542','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Joel', 'Wells', '1970-05-04'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741633', '1-5478573', '9812345793', 'joel_wells@gmail.com', 'www.joel.com', '5412664', '12457964','4578543','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Ivan', 'Webb', '1970-05-05'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741634', '1-5478574', '9812345794', 'ivan_webb@gmail.com', 'www.ivan.com', '5412665', '12457965','4578544','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Josiah', 'Simpson', '1970-05-06'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741635', '1-5478575', '9812345795', 'josiah_simpson@gmail.com', 'www.josiah.com', '5412666', '12457966','4578545','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Alan', 'Stevens', '1970-05-07'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741636', '1-5478576', '9812345796', 'alan_stevens@gmail.com', 'www.alan.com', '5412667', '12457967','4578546','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Conner', 'Tucker', '1970-05-08'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741637', '1-5478577', '9812345797', 'conner_tucker@gmail.com', 'www.conner.com', '5412668', '12457968','4578547','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Eduardo', 'Porter', '1970-05-09'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741638', '1-5478578', '9812345798', 'eduardo_porter@gmail.com', 'www.eduardo.com', '5412669', '12457969','4578548','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Paul', 'Hunter', '1970-05-10'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741639', '1-5478579', '9812345799', 'paul_hunter@gmail.com', 'www.paul.com', '5412670', '12457970','4578549','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Tanner', 'Hicks', '1970-05-11'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741640', '1-5478580', '9812345800', 'tanner_hicks@gmail.com', 'www.tanner.com', '5412671', '12457971','4578550','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Braden', 'Crawford', '1970-05-12'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741641', '1-5478581', '9812345801', 'braden_crawford@gmail.com', 'www.braden.com', '5412672', '12457972','4578551','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Alexis', 'Henry', '1970-05-13'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741642', '1-5478582', '9812345802', 'alexis_henry@gmail.com', 'www.alexis.com', '5412673', '12457973','4578552','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Edward', 'Boyd', '1970-05-14'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741643', '1-5478583', '9812345803', 'edward_boyd@gmail.com', 'www.edward.com', '5412674', '12457974','4578553','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Omar', 'Mason', '1970-05-15'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741644', '1-5478584', '9812345804', 'omar_mason@gmail.com', 'www.omar.com', '5412675', '12457975','4578554','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Nicolas', 'Morales', '1970-05-16'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741645', '1-5478585', '9812345805', 'nicolas_morales@gmail.com', 'www.nicolas.com', '5412676', '12457976','4578555','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Jared', 'Kennedy', '1970-05-17'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741646', '1-5478586', '9812345806', 'jared_kennedy@gmail.com', 'www.jared.com', '5412677', '12457977','4578556','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Peyton', 'Warren', '1970-05-18'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741647', '1-5478587', '9812345807', 'peyton_warren@gmail.com', 'www.peyton.com', '5412678', '12457978','4578557','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'George', 'Dixon', '1970-05-19'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741648', '1-5478588', '9812345808', 'george_dixon@gmail.com', 'www.george.com', '5412679', '12457979','4578558','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Maxwell', 'Ramos', '1970-05-20'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741649', '1-5478589', '9812345809', 'maxwell_ramos@gmail.com', 'www.maxwell.com', '5412680', '12457980','4578559','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Cristian', 'Reyes', '1970-05-21'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741650', '1-5478590', '9812345810', 'cristian_reyes@gmail.com', 'www.cristian.com', '5412681', '12457981','4578560','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Francisco', 'Burns', '1970-05-22'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741651', '1-5478591', '9812345811', 'francisco_burns@gmail.com', 'www.francisco.com', '5412682', '12457982','4578561','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Collin', 'Gordon', '1970-05-23'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741652', '1-5478592', '9812345812', 'collin_gordon@gmail.com', 'www.collin.com', '5412683', '12457983','4578562','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Nolan', 'Shaw', '1970-05-24'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741653', '1-5478593', '9812345813', 'nolan_shaw@gmail.com', 'www.nolan.com', '5412684', '12457984','4578563','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Preston', 'Holmes', '1970-05-25'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741654', '1-5478594', '9812345814', 'preston_holmes@gmail.com', 'www.preston.com', '5412685', '12457985','4578564','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Stephen', 'Rice', '1970-05-26'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741655', '1-5478595', '9812345815', 'stephen_rice@gmail.com', 'www.stephen.com', '5412686', '12457986','4578565','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Ayden', 'Robertson', '1970-05-27'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741656', '1-5478596', '9812345816', 'ayden_robertson@gmail.com', 'www.ayden.com', '5412687', '12457987','4578566','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Gage', 'Hunt', '1970-05-28'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741657', '1-5478597', '9812345817', 'gage_hunt@gmail.com', 'www.gage.com', '5412688', '12457988','4578567','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Levi', 'Black', '1970-05-29'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741658', '1-5478598', '9812345818', 'levi_black@gmail.com', 'www.levi.com', '5412689', '12457989','4578568','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Dakota', 'Daniels', '1970-05-30'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741659', '1-5478599', '9812345819', 'dakota_daniels@gmail.com', 'www.dakota.com', '5412690', '12457990','4578569','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Micah', 'Palmer', '1970-05-31'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741660', '1-5478600', '9812345820', 'micah_palmer@gmail.com', 'www.micah.com', '5412691', '12457991','4578570','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Eli', 'Mills', '1970-06-01'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741661', '1-5478601', '9812345821', 'eli_mills@gmail.com', 'www.eli.com', '5412692', '12457992','4578571','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Manuel', 'Nichols', '1970-06-02'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741662', '1-5478602', '9812345822', 'manuel_nichols@gmail.com', 'www.manuel.com', '5412693', '12457993','4578572','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Grant', 'Grant', '1970-06-03'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741663', '1-5478603', '9812345823', 'grant_grant@gmail.com', 'www.grant.com', '5412694', '12457994','4578573','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Colton', 'Knight', '1970-06-04'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741664', '1-5478604', '9812345824', 'colton_knight@gmail.com', 'www.colton.com', '5412695', '12457995','4578574','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Damian', 'Ferguson', '1970-06-05'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741665', '1-5478605', '9812345825', 'damian_ferguson@gmail.com', 'www.damian.com', '5412696', '12457996','4578575','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Ricardo', 'Rose', '1970-06-06'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741666', '1-5478606', '9812345826', 'ricardo_rose@gmail.com', 'www.ricardo.com', '5412697', '12457997','4578576','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Giovanni', 'Stone', '1970-06-07'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741667', '1-5478607', '9812345827', 'giovanni_stone@gmail.com', 'www.giovanni.com', '5412698', '12457998','4578577','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Andres', 'Hawkins', '1970-06-08'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741668', '1-5478608', '9812345828', 'andres_hawkins@gmail.com', 'www.andres.com', '5412699', '12457999','4578578','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Emmanuel', 'Dunn', '1970-06-09'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741669', '1-5478609', '9812345829', 'emmanuel_dunn@gmail.com', 'www.emmanuel.com', '5412700', '12458000','4578579','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Peter', 'Perkins', '1970-06-10'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741670', '1-5478610', '9812345830', 'peter_perkins@gmail.com', 'www.peter.com', '5412701', '12458001','4578580','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Malachi', 'Hudson', '1970-06-11'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741671', '1-5478611', '9812345831', 'malachi_hudson@gmail.com', 'www.malachi.com', '5412702', '12458002','4578581','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Cesar', 'Spencer', '1970-06-12'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741672', '1-5478612', '9812345832', 'cesar_spencer@gmail.com', 'www.cesar.com', '5412703', '12458003','4578582','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Javier', 'Gardner', '1970-06-13'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741673', '1-5478613', '9812345833', 'javier_gardner@gmail.com', 'www.javier.com', '5412704', '12458004','4578583','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Max', 'Stephens', '1970-06-14'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741674', '1-5478614', '9812345834', 'maximum_stephens@gmail.com', 'www.max.com', '5412705', '12458005','4578584','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Hector', 'Payne', '1970-06-15'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741675', '1-5478615', '9812345835', 'hector_payne@gmail.com', 'www.hector.com', '5412706', '12458006','4578585','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Edgar', 'Pierce', '1970-06-16'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741676', '1-5478616', '9812345836', 'edgar_pierce@gmail.com', 'www.edgar.com', '5412707', '12458007','4578586','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Shane', 'Berry', '1970-06-17'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741677', '1-5478617', '9812345837', 'shane_berry@gmail.com', 'www.shane.com', '5412708', '12458008','4578587','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Fernando', 'Matthews', '1970-06-18'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741678', '1-5478618', '9812345838', 'fernando_matthews@gmail.com', 'www.fernando.com', '5412709', '12458009','4578588','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Ty', 'Arnold', '1970-06-19'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741679', '1-5478619', '9812345839', 'ty_arnold@gmail.com', 'www.ty.com', '5412710', '12458010','4578589','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Jeffrey', 'Wagner', '1970-06-20'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741680', '1-5478620', '9812345840', 'jeffrey_wagner@gmail.com', 'www.jeffrey.com', '5412711', '12458011','4578590','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Bradley', 'Willis', '1970-06-21'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741681', '1-5478621', '9812345841', 'bradley_willis@gmail.com', 'www.bradley.com', '5412712', '12458012','4578591','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Derek', 'Ray', '1970-06-22'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741682', '1-5478622', '9812345842', 'derek_ray@gmail.com', 'www.derek.com', '5412713', '12458013','4578592','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Travis', 'Watkins', '1970-06-23'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741683', '1-5478623', '9812345843', 'travis_watkins@gmail.com', 'www.travis.com', '5412714', '12458014','4578593','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Brendan', 'Olson', '1970-06-24'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741684', '1-5478624', '9812345844', 'brendan_olson@gmail.com', 'www.brendan.com', '5412715', '12458015','4578594','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Shawn', 'Carroll', '1970-06-25'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741685', '1-5478625', '9812345845', 'shawn_carroll@gmail.com', 'www.shawn.com', '5412716', '12458016','4578595','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Edwin', 'Duncan', '1970-06-26'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741686', '1-5478626', '9812345846', 'edwin_duncan@gmail.com', 'www.edwin.com', '5412717', '12458017','4578596','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Spencer', 'Snyder', '1970-06-27'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741687', '1-5478627', '9812345847', 'spencer_snyder@gmail.com', 'www.spencer.com', '5412718', '12458018','4578597','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Mario', 'Hart', '1970-06-28'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741688', '1-5478628', '9812345848', 'mario_hart@gmail.com', 'www.mario.com', '5412719', '12458019','4578598','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Dalton', 'Cunningham', '1970-06-29'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741689', '1-5478629', '9812345849', 'dalton_cunningham@gmail.com', 'www.dalton.com', '5412720', '12458020','4578599','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Erick', 'Bradley', '1970-06-30'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741690', '1-5478630', '9812345850', 'erick_bradley@gmail.com', 'www.erick.com', '5412721', '12458021','4578600','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Johnathan', 'Lane', '1970-07-01'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741691', '1-5478631', '9812345851', 'johnathan_lane@gmail.com', 'www.johnathan.com', '5412722', '12458022','4578601','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Erik', 'Andrews', '1970-07-02'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741692', '1-5478632', '9812345852', 'erik_andrews@gmail.com', 'www.erik.com', '5412723', '12458023','4578602','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Jonah', 'Ruiz', '1970-07-03'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741693', '1-5478633', '9812345853', 'jonah_ruiz@gmail.com', 'www.jonah.com', '5412724', '12458024','4578603','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Donovan', 'Harper', '1970-07-04'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741694', '1-5478634', '9812345854', 'donovan_harper@gmail.com', 'www.donovan.com', '5412725', '12458025','4578604','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Leonardo', 'Fox', '1970-07-05'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741695', '1-5478635', '9812345855', 'leonardo_fox@gmail.com', 'www.leonardo.com', '5412726', '12458026','4578605','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Wesley', 'Riley', '1970-07-06'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741696', '1-5478636', '9812345856', 'wesley_riley@gmail.com', 'www.wesley.com', '5412727', '12458027','4578606','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Elias', 'Armstrong', '1970-07-07'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741697', '1-5478637', '9812345857', 'elias_armstrong@gmail.com', 'www.elias.com', '5412728', '12458028','4578607','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Marco', 'Carpenter', '1970-07-08'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741698', '1-5478638', '9812345858', 'marco_carpenter@gmail.com', 'www.marco.com', '5412729', '12458029','4578608','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Trenton', 'Weaver', '1970-07-09'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741699', '1-5478639', '9812345859', 'trenton_weaver@gmail.com', 'www.trenton.com', '5412730', '12458030','4578609','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Devon', 'Greene', '1970-07-10'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741700', '1-5478640', '9812345860', 'devon_greene@gmail.com', 'www.devon.com', '5412731', '12458031','4578610','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Brody', 'Lawrence', '1970-07-11'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741701', '1-5478641', '9812345861', 'brody_lawrence@gmail.com', 'www.brody.com', '5412732', '12458032','4578611','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Abraham', 'Elliott', '1970-07-12'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741702', '1-5478642', '9812345862', 'abraham_elliott@gmail.com', 'www.abraham.com', '5412733', '12458033','4578612','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Jaylen', 'Chavez', '1970-07-13'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741703', '1-5478643', '9812345863', 'jaylen_chavez@gmail.com', 'www.jaylen.com', '5412734', '12458034','4578613','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Bryson', 'Sims', '1970-07-14'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741704', '1-5478644', '9812345864', 'bryson_sims@gmail.com', 'www.bryson.com', '5412735', '12458035','4578614','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Josue', 'Austin', '1970-07-15'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741705', '1-5478645', '9812345865', 'josue_austin@gmail.com', 'www.josue.com', '5412736', '12458036','4578615','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Sergio', 'Peters', '1970-07-16'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741706', '1-5478646', '9812345866', 'sergio_peters@gmail.com', 'www.sergio.com', '5412737', '12458037','4578616','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Drew', 'Kelley', '1970-07-17'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741707', '1-5478647', '9812345867', 'drew_kelley@gmail.com', 'www.drew.com', '5412738', '12458038','4578617','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Damien', 'Franklin', '1970-07-18'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741708', '1-5478648', '9812345868', 'damien_franklin@gmail.com', 'www.damien.com', '5412739', '12458039','4578618','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Raymond', 'Lawson', '1970-07-19'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741709', '1-5478649', '9812345869', 'raymond_lawson@gmail.com', 'www.raymond.com', '5412740', '12458040','4578619','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Andy', 'Fields', '1970-07-20'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741710', '1-5478650', '9812345870', 'andy_fields@gmail.com', 'www.andy.com', '5412741', '12458041','4578620','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Dillon', 'Gutierrez', '1970-07-21'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741711', '1-5478651', '9812345871', 'dillon_gutierrez@gmail.com', 'www.dillon.com', '5412742', '12458042','4578621','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Gregory', 'Ryan', '1970-07-22'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741712', '1-5478652', '9812345872', 'gregory_ryan@gmail.com', 'www.gregory.com', '5412743', '12458043','4578622','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Roberto', 'Schmidt', '1970-07-23'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741713', '1-5478653', '9812345873', 'roberto_schmidt@gmail.com', 'www.roberto.com', '5412744', '12458044','4578623','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Roman', 'Carr', '1970-07-24'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741714', '1-5478654', '9812345874', 'roman_carr@gmail.com', 'www.roman.com', '5412745', '12458045','4578624','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Martin', 'Vasquez', '1970-07-25'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741715', '1-5478655', '9812345875', 'martin_vasquez@gmail.com', 'www.martin.com', '5412746', '12458046','4578625','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Andre', 'Castillo', '1970-07-26'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741716', '1-5478656', '9812345876', 'andre_castillo@gmail.com', 'www.andre.com', '5412747', '12458047','4578626','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Jace', 'Wheeler', '1970-07-27'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741717', '1-5478657', '9812345877', 'jace_wheeler@gmail.com', 'www.jace.com', '5412748', '12458048','4578627','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Oliver', 'Chapman', '1970-07-28'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741718', '1-5478658', '9812345878', 'oliver_chapman@gmail.com', 'www.oliver.com', '5412749', '12458049','4578628','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Miles', 'Oliver', '1970-07-29'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741719', '1-5478659', '9812345879', 'miles_oliver@gmail.com', 'www.miles.com', '5412750', '12458050','4578629','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Harrison', 'Montgomery', '1970-07-30'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741720', '1-5478660', '9812345880', 'harrison_montgomery@gmail.com', 'www.harrison.com', '5412751', '12458051','4578630','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Jalen', 'Richards', '1970-07-31'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741721', '1-5478661', '9812345881', 'jalen_richards@gmail.com', 'www.jalen.com', '5412752', '12458052','4578631','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'corey', 'Williamson', '1970-08-01'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741722', '1-5478662', '9812345882', 'corey_williamson@gmail.com', 'www.corey.com', '5412753', '12458053','4578632','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Dominick', 'Johnston', '1970-08-02'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741723', '1-5478663', '9812345883', 'dominick_johnston@gmail.com', 'www.dominick.com', '5412754', '12458054','4578633','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Avery', 'Banks', '1970-08-03'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741724', '1-5478664', '9812345884', 'avery_banks@gmail.com', 'www.avery.com', '5412755', '12458055','4578634','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Clayton', 'Meyer', '1970-08-04'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741725', '1-5478665', '9812345885', 'clayton_meyer@gmail.com', 'www.clayton.com', '5412756', '12458056','4578635','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Pedro', 'Bishop', '1970-08-05'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741726', '1-5478666', '9812345886', 'pedro_bishop@gmail.com', 'www.pedro.com', '5412757', '12458057','4578636','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Israel', 'Mccoy', '1970-08-06'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741727', '1-5478667', '9812345887', 'israel_mccoy@gmail.com', 'www.israel.com', '5412758', '12458058','4578637','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Calvin', 'Howell', '1970-08-07'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741728', '1-5478668', '9812345888', 'calvin_howell@gmail.com', 'www.calvin.com', '5412759', '12458059','4578638','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Colby', 'Alvarez', '1970-08-08'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741729', '1-5478669', '9812345889', 'colby_alvarez@gmail.com', 'www.colby.com', '5412760', '12458060','4578639','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Dawson', 'Morrison', '1970-08-09'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741730', '1-5478670', '9812345890', 'dawson_morrison@gmail.com', 'www.dawson.com', '5412761', '12458061','4578640','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Cayden', 'Hansen', '1970-08-10'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741731', '1-5478671', '9812345891', 'cayden_hansen@gmail.com', 'www.cayden.com', '5412762', '12458062','4578641','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Jaiden', 'Fernandez', '1970-08-11'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741732', '1-5478672', '9812345892', 'jaiden_fernandez@gmail.com', 'www.jaiden.com', '5412763', '12458063','4578642','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Taylor', 'Garza', '1970-08-12'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741733', '1-5478673', '9812345893', 'taylor_garza@gmail.com', 'www.taylor.com', '5412764', '12458064','4578643','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Landen', 'Harvey', '1970-08-13'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741734', '1-5478674', '9812345894', 'landen_harvey@gmail.com', 'www.landen.com', '5412765', '12458065','4578644','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Troy', 'Little', '1970-08-14'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741735', '1-5478675', '9812345895', 'troy_little@gmail.com', 'www.troy.com', '5412766', '12458066','4578645','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Julio', 'Burton', '1970-08-15'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741736', '1-5478676', '9812345896', 'julio_burton@gmail.com', 'www.julio.com', '5412767', '12458067','4578646','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Trey', 'Stanley', '1970-08-16'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741737', '1-5478677', '9812345897', 'trey_stanley@gmail.com', 'www.trey.com', '5412768', '12458068','4578647','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Jaxon', 'Nguyen', '1970-08-17'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741738', '1-5478678', '9812345898', 'jaxon_nguyen@gmail.com', 'www.jaxon.com', '5412769', '12458069','4578648','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Rafael', 'George', '1970-08-18'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741739', '1-5478679', '9812345899', 'rafael_george@gmail.com', 'www.rafael.com', '5412770', '12458070','4578649','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Dustin', 'Jacobs', '1970-08-19'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741740', '1-5478680', '9812345900', 'dustin_jacobs@gmail.com', 'www.dustin.com', '5412771', '12458071','4578650','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Ruben', 'Reid', '1970-08-20'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741741', '1-5478681', '9812345901', 'ruben_reid@gmail.com', 'www.ruben.com', '5412772', '12458072','4578651','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Camden', 'Kim', '1970-08-21'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741742', '1-5478682', '9812345902', 'camden_kim@gmail.com', 'www.camden.com', '5412773', '12458073','4578652','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Frank', 'Fuller', '1970-08-22'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741743', '1-5478683', '9812345903', 'frank_fuller@gmail.com', 'www.frank.com', '5412774', '12458074','4578653','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Scott', 'Lynch', '1970-08-23'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741744', '1-5478684', '9812345904', 'scott_lynch@gmail.com', 'www.scott.com', '5412775', '12458075','4578654','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Mitchell', 'Dean', '1970-08-24'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741745', '1-5478685', '9812345905', 'mitchell_dean@gmail.com', 'www.mitchell.com', '5412776', '12458076','4578655','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Zane', 'Gilbert', '1970-08-25'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741746', '1-5478686', '9812345906', 'zane_gilbert@gmail.com', 'www.zane.com', '5412777', '12458077','4578656','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Payton', 'Garrett', '1970-08-26'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741747', '1-5478687', '9812345907', 'payton_garrett@gmail.com', 'www.payton.com', '5412778', '12458078','4578657','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Kai', 'Romero', '1970-08-27'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741748', '1-5478688', '9812345908', 'kai_romero@gmail.com', 'www.kai.com', '5412779', '12458079','4578658','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Keegan', 'Welch', '1970-08-28'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741749', '1-5478689', '9812345909', 'keegan_welch@gmail.com', 'www.keegan.com', '5412780', '12458080','4578659','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Skyler', 'Larson', '1970-08-29'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741750', '1-5478690', '9812345910', 'skyler_larson@gmail.com', 'www.skyler.com', '5412781', '12458081','4578660','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Brett', 'Frazier', '1970-08-30'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741751', '1-5478691', '9812345911', 'brett_frazier@gmail.com', 'www.brett.com', '5412782', '12458082','4578661','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Johnny', 'Burke', '1970-08-31'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741752', '1-5478692', '9812345912', 'johnny_burke@gmail.com', 'www.johnny.com', '5412783', '12458083','4578662','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Griffin', 'Hanson', '1970-09-01'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741753', '1-5478693', '9812345913', 'griffin_hanson@gmail.com', 'www.griffin.com', '5412784', '12458084','4578663','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Marcos', 'Day', '1970-09-02'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741754', '1-5478694', '9812345914', 'marcos_day@gmail.com', 'www.marcos.com', '5412785', '12458085','4578664','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Beau', 'Stokes', '1971-02-22'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741927', '1-5478867', '9812346087', 'beau_stokes@gmail.com', 'www.beau.com', '5412958', '12458258','4578837','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Derrick', 'Mendoza', '1970-09-03'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741755', '1-5478695', '9812345915', 'derrick_mendoza@gmail.com', 'www.derrick.com', '5412786', '12458086','4578665','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Drake', 'Moreno', '1970-09-04'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741756', '1-5478696', '9812345916', 'drake_moreno@gmail.com', 'www.drake.com', '5412787', '12458087','4578666','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Raul', 'Bowman', '1970-09-05'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741757', '1-5478697', '9812345917', 'raul_bowman@gmail.com', 'www.raul.com', '5412788', '12458088','4578667','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Kaiden', 'Medina', '1970-09-06'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741758', '1-5478698', '9812345918', 'kaiden_medina@gmail.com', 'www.kaiden.com', '5412789', '12458089','4578668','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Gerardo', 'Fowler', '1970-09-07'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741759', '1-5478699', '9812345919', 'gerardo_fowler@gmail.com', 'www.gerardo.com', '5412790', '12458090','4578669','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Braxton', 'Brewer', '1970-09-08'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741760', '1-5478700', '9812345920', 'braxton_brewer@gmail.com', 'www.braxton.com', '5412791', '12458091','4578670','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Armando', 'Hoffman', '1970-09-09'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741761', '1-5478701', '9812345921', 'armando_hoffman@gmail.com', 'www.armando.com', '5412792', '12458092','4578671','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Grayson', 'Carlson', '1970-09-10'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741762', '1-5478702', '9812345922', 'grayson_carlson@gmail.com', 'www.grayson.com', '5412793', '12458093','4578672','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Simon', 'Silva', '1970-09-11'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741763', '1-5478703', '9812345923', 'simon_silva@gmail.com', 'www.simon.com', '5412794', '12458094','4578673','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Kayden', 'Pearson', '1970-09-12'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741764', '1-5478704', '9812345924', 'kayden_pearson@gmail.com', 'www.kayden.com', '5412795', '12458095','4578674','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Ronald', 'Holland', '1970-09-13'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741765', '1-5478705', '9812345925', 'ronald_holland@gmail.com', 'www.ronald.com', '5412796', '12458096','4578675','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Angelo', 'Douglas', '1970-09-14'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741766', '1-5478706', '9812345926', 'angelo_douglas@gmail.com', 'www.angelo.com', '5412797', '12458097','4578676','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Leo', 'Fleming', '1970-09-15'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741767', '1-5478707', '9812345927', 'leo_fleming@gmail.com', 'www.leo.com', '5412798', '12458098','4578677','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Chance', 'Jensen', '1970-09-16'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741768', '1-5478708', '9812345928', 'chance_jensen@gmail.com', 'www.chance.com', '5412799', '12458099','4578678','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Brock', 'Vargas', '1970-09-17'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741769', '1-5478709', '9812345929', 'brock_vargas@gmail.com', 'www.brock.com', '5412800', '12458100','4578679','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Lukas', 'Byrd', '1970-09-18'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741770', '1-5478710', '9812345930', 'lukas_byrd@gmail.com', 'www.lukas.com', '5412801', '12458101','4578680','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Jaime', 'Davidson', '1970-09-19'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741771', '1-5478711', '9812345931', 'jaime_davidson@gmail.com', 'www.jaime.com', '5412802', '12458102','4578681','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Lance', 'Hopkins', '1970-09-20'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741772', '1-5478712', '9812345932', 'lance_hopkins@gmail.com', 'www.lance.com', '5412803', '12458103','4578682','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Enrique', 'May', '1970-09-21'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741773', '1-5478713', '9812345933', 'enrique_may@gmail.com', 'www.enrique.com', '5412804', '12458104','4578683','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Dante', 'Terry', '1970-09-22'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741774', '1-5478714', '9812345934', 'dante_terry@gmail.com', 'www.dante.com', '5412805', '12458105','4578684','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Malik', 'Herrera', '1970-09-23'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741775', '1-5478715', '9812345935', 'malik_herrera@gmail.com', 'www.malik.com', '5412806', '12458106','4578685','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Tyson', 'Wade', '1970-09-24'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741776', '1-5478716', '9812345936', 'tyson_wade@gmail.com', 'www.tyson.com', '5412807', '12458107','4578686','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Emanuel', 'Soto', '1970-09-25'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741777', '1-5478717', '9812345937', 'emanuel_soto@gmail.com', 'www.emanuel.com', '5412808', '12458108','4578687','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Phillip', 'Walters', '1970-09-26'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741778', '1-5478718', '9812345938', 'phillip_walters@gmail.com', 'www.phillip.com', '5412809', '12458109','4578688','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Fabian', 'Curtis', '1970-09-27'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741779', '1-5478719', '9812345939', 'fabian_curtis@gmail.com', 'www.fabian.com', '5412810', '12458110','4578689','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Tucker', 'Neal', '1970-09-28'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741780', '1-5478720', '9812345940', 'tucker_neal@gmail.com', 'www.tucker.com', '5412811', '12458111','4578690','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Trent', 'Caldwell', '1970-09-29'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741781', '1-5478721', '9812345941', 'trent_caldwell@gmail.com', 'www.trent.com', '5412812', '12458112','4578691','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Allen', 'Lowe', '1970-09-30'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741782', '1-5478722', '9812345942', 'allen_lowe@gmail.com', 'www.allen.com', '5412813', '12458113','4578692','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Jakob', 'Jennings', '1970-10-01'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741783', '1-5478723', '9812345943', 'jakob_jennings@gmail.com', 'www.jakob.com', '5412814', '12458114','4578693','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Hudson', 'Barnett', '1970-10-02'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741784', '1-5478724', '9812345944', 'hudson_barnett@gmail.com', 'www.hudson.com', '5412815', '12458115','4578694','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Emilio', 'Graves', '1970-10-03'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741785', '1-5478725', '9812345945', 'emilio_graves@gmail.com', 'www.emilio.com', '5412816', '12458116','4578695','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Maddox', 'Jimenez', '1970-10-04'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741786', '1-5478726', '9812345946', 'maddox_jimenez@gmail.com', 'www.maddox.com', '5412817', '12458117','4578696','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Santiago', 'Horton', '1970-10-05'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741787', '1-5478727', '9812345947', 'santiago_horton@gmail.com', 'www.santiago.com', '5412818', '12458118','4578697','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Xander', 'Shelton', '1970-10-06'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741788', '1-5478728', '9812345948', 'xander_shelton@gmail.com', 'www.xander.com', '5412819', '12458119','4578698','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Aden', 'Barrett', '1970-10-07'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741789', '1-5478729', '9812345949', 'aden_barrett@gmail.com', 'www.aden.com', '5412820', '12458120','4578699','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Rylan', 'Obrien', '1970-10-08'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741790', '1-5478730', '9812345950', 'rylan_obrien@gmail.com', 'www.rylan.com', '5412821', '12458121','4578700','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Kyler', 'Castro', '1970-10-09'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741791', '1-5478731', '9812345951', 'kyler_castro@gmail.com', 'www.kyler.com', '5412822', '12458122','4578701','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Kameron', 'Sutton', '1970-10-10'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741792', '1-5478732', '9812345952', 'kameron_sutton@gmail.com', 'www.kameron.com', '5412823', '12458123','4578702','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Pablo', 'Gregory', '1970-10-11'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741793', '1-5478733', '9812345953', 'pablo_gregory@gmail.com', 'www.pablo.com', '5412824', '12458124','4578703','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Cade', 'Mckinney', '1970-10-12'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741794', '1-5478734', '9812345954', 'cade_mckinney@gmail.com', 'www.cade.com', '5412825', '12458125','4578704','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Adan', 'Lucas', '1970-10-13'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741795', '1-5478735', '9812345955', 'adan_lucas@gmail.com', 'www.adan.com', '5412826', '12458126','4578705','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Keith', 'Miles', '1970-10-14'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741796', '1-5478736', '9812345956', 'keith_miles@gmail.com', 'www.keith.com', '5412827', '12458127','4578706','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Asher', 'Craig', '1970-10-15'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741797', '1-5478737', '9812345957', 'asher_craig@gmail.com', 'www.asher.com', '5412828', '12458128','4578707','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Donald', 'Rodriquez', '1970-10-16'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741798', '1-5478738', '9812345958', 'donald_rodriquez@gmail.com', 'www.donald.com', '5412829', '12458129','4578708','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Alberto', 'Chambers', '1970-10-17'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741799', '1-5478739', '9812345959', 'alberto_chambers@gmail.com', 'www.alberto.com', '5412830', '12458130','4578709','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Alec', 'Holt', '1970-10-18'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741800', '1-5478740', '9812345960', 'alec_holt@gmail.com', 'www.alec.com', '5412831', '12458131','4578710','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Darius', 'Lambert', '1970-10-19'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741801', '1-5478741', '9812345961', 'darius_lambert@gmail.com', 'www.darius.com', '5412832', '12458132','4578711','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Gustavo', 'Fletcher', '1970-10-20'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741802', '1-5478742', '9812345962', 'gustavo_fletcher@gmail.com', 'www.gustavo.com', '5412833', '12458133','4578712','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Saul', 'Watts', '1970-10-21'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741803', '1-5478743', '9812345963', 'saul_watts@gmail.com', 'www.saul.com', '5412834', '12458134','4578713','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Ryder', 'Bates', '1970-10-22'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741804', '1-5478744', '9812345964', 'ryder_bates@gmail.com', 'www.ryder.com', '5412835', '12458135','4578714','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Zion', 'Hale', '1970-10-23'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741805', '1-5478745', '9812345965', 'zion_hale@gmail.com', 'www.zion.com', '5412836', '12458136','4578715','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Casey', 'Rhodes', '1970-10-24'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741806', '1-5478746', '9812345966', 'casey_rhodes@gmail.com', 'www.casey.com', '5412837', '12458137','4578716','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Gael', 'Pena', '1970-10-25'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741807', '1-5478747', '9812345967', 'gael_pena@gmail.com', 'www.gael.com', '5412838', '12458138','4578717','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Mathew', 'Beck', '1970-10-26'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741808', '1-5478748', '9812345968', 'mathew_beck@gmail.com', 'www.mathew.com', '5412839', '12458139','4578718','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Arturo', 'Newman', '1970-10-27'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741809', '1-5478749', '9812345969', 'arturo_newman@gmail.com', 'www.arturo.com', '5412840', '12458140','4578719','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Randy', 'Haynes', '1970-10-28'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741810', '1-5478750', '9812345970', 'randy_haynes@gmail.com', 'www.randy.com', '5412841', '12458141','4578720','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Mateo', 'Mcdaniel', '1970-10-29'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741811', '1-5478751', '9812345971', 'mateo_mcdaniel@gmail.com', 'www.mateo.com', '5412842', '12458142','4578721','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Quinn', 'Mendez', '1970-10-30'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741812', '1-5478752', '9812345972', 'quinn_mendez@gmail.com', 'www.quinn.com', '5412843', '12458143','4578722','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Jimmy', 'Bush', '1970-10-31'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741813', '1-5478753', '9812345973', 'jimmy_bush@gmail.com', 'www.jimmy.com', '5412844', '12458144','4578723','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Theodore', 'Vaughn', '1970-11-01'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741814', '1-5478754', '9812345974', 'theodore_vaughn@gmail.com', 'www.theodore.com', '5412845', '12458145','4578724','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Jude', 'Parks', '1970-11-02'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741815', '1-5478755', '9812345975', 'jude_parks@gmail.com', 'www.jude.com', '5412846', '12458146','4578725','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Sawyer', 'Dawson', '1970-11-03'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741816', '1-5478756', '9812345976', 'sawyer_dawson@gmail.com', 'www.sawyer.com', '5412847', '12458147','4578726','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Zackary', 'Santiago', '1970-11-04'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741817', '1-5478757', '9812345977', 'zackary_santiago@gmail.com', 'www.zackary.com', '5412848', '12458148','4578727','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Ezekiel', 'Norris', '1970-11-05'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741818', '1-5478758', '9812345978', 'ezekiel_norris@gmail.com', 'www.ezekiel.com', '5412849', '12458149','4578728','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Myles', 'Hardy', '1970-11-06'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741819', '1-5478759', '9812345979', 'myles_hardy@gmail.com', 'www.myles.com', '5412850', '12458150','4578729','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Corbin', 'Love', '1970-11-07'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741820', '1-5478760', '9812345980', 'corbin_love@gmail.com', 'www.corbin.com', '5412851', '12458151','4578730','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Danny', 'Steele', '1970-11-08'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741821', '1-5478761', '9812345981', 'danny_steele@gmail.com', 'www.danny.com', '5412852', '12458152','4578731','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Axel', 'Curry', '1970-11-09'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741822', '1-5478762', '9812345982', 'axel_curry@gmail.com', 'www.axel.com', '5412853', '12458153','4578732','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Brennan', 'Powers', '1970-11-10'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741823', '1-5478763', '9812345983', 'brennan_powers@gmail.com', 'www.brennan.com', '5412854', '12458154','4578733','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Lane', 'Schultz', '1970-11-11'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741824', '1-5478764', '9812345984', 'lane_schultz@gmail.com', 'www.lane.com', '5412855', '12458155','4578734','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Jerry', 'Barker', '1970-11-12'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741825', '1-5478765', '9812345985', 'jerry_barker@gmail.com', 'www.jerry.com', '5412856', '12458156','4578735','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Dennis', 'Guzman', '1970-11-13'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741826', '1-5478766', '9812345986', 'dennis_guzman@gmail.com', 'www.dennis.com', '5412857', '12458157','4578736','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Lorenzo', 'Page', '1970-11-14'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741827', '1-5478767', '9812345987', 'lorenzo_page@gmail.com', 'www.lorenzo.com', '5412858', '12458158','4578737','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Esteban', 'Munoz', '1970-11-15'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741828', '1-5478768', '9812345988', 'esteban_munoz@gmail.com', 'www.esteban.com', '5412859', '12458159','4578738','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Tony', 'Ball', '1970-11-16'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741829', '1-5478769', '9812345989', 'tony_ball@gmail.com', 'www.tony.com', '5412860', '12458160','4578739','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Brenden', 'Keller', '1970-11-17'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741830', '1-5478770', '9812345990', 'brenden_keller@gmail.com', 'www.brenden.com', '5412861', '12458161','4578740','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Damon', 'Chandler', '1970-11-18'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741831', '1-5478771', '9812345991', 'damon_chandler@gmail.com', 'www.damon.com', '5412862', '12458162','4578741','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Braeden', 'Weber', '1970-11-19'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741832', '1-5478772', '9812345992', 'braeden_weber@gmail.com', 'www.braeden.com', '5412863', '12458163','4578742','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Louis', 'Leonard', '1970-11-20'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741833', '1-5478773', '9812345993', 'louis_leonard@gmail.com', 'www.louis.com', '5412864', '12458164','4578743','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Philip', 'Walsh', '1970-11-21'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741834', '1-5478774', '9812345994', 'philip_walsh@gmail.com', 'www.philip.com', '5412865', '12458165','4578744','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Brayan', 'Lyons', '1970-11-22'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741835', '1-5478775', '9812345995', 'brayan_lyons@gmail.com', 'www.brayan.com', '5412866', '12458166','4578745','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Curtis', 'Ramsey', '1970-11-23'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741836', '1-5478776', '9812345996', 'curtis_ramsey@gmail.com', 'www.curtis.com', '5412867', '12458167','4578746','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Charlie', 'Wolfe', '1970-11-24'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741837', '1-5478777', '9812345997', 'charlie_wolfe@gmail.com', 'www.charlie.com', '5412868', '12458168','4578747','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Nickolas', 'Schneider', '1970-11-25'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741838', '1-5478778', '9812345998', 'nickolas_schneider@gmail.com', 'www.nickolas.com', '5412869', '12458169','4578748','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Jayson', 'Mullins', '1970-11-26'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741839', '1-5478779', '9812345999', 'jayson_mullins@gmail.com', 'www.jayson.com', '5412870', '12458170','4578749','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Jonathon', 'Benson', '1970-11-27'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741840', '1-5478780', '9812346000', 'jonathon_benson@gmail.com', 'www.jonathon.com', '5412871', '12458171','4578750','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Zander', 'Sharp', '1970-11-28'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741841', '1-5478781', '9812346001', 'zander_sharp@gmail.com', 'www.zander.com', '5412872', '12458172','4578751','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Nikolas', 'Bowen', '1970-11-29'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741842', '1-5478782', '9812346002', 'nikolas_bowen@gmail.com', 'www.nikolas.com', '5412873', '12458173','4578752','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Quentin', 'Daniel', '1970-11-30'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741843', '1-5478783', '9812346003', 'quentin_daniel@gmail.com', 'www.quentin.com', '5412874', '12458174','4578753','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Morgan', 'Barber', '1970-12-01'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741844', '1-5478784', '9812346004', 'morgan_barber@gmail.com', 'www.morgan.com', '5412875', '12458175','4578754','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Ismael', 'Cummings', '1970-12-02'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741845', '1-5478785', '9812346005', 'ismael_cummings@gmail.com', 'www.ismael.com', '5412876', '12458176','4578755','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Emiliano', 'Hines', '1970-12-03'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741846', '1-5478786', '9812346006', 'emiliano_hines@gmail.com', 'www.emiliano.com', '5412877', '12458177','4578756','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Gary', 'Baldwin', '1970-12-04'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741847', '1-5478787', '9812346007', 'gary_baldwin@gmail.com', 'www.gary.com', '5412878', '12458178','4578757','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Tristen', 'Griffith', '1970-12-05'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741848', '1-5478788', '9812346008', 'tristen_griffith@gmail.com', 'www.tristen.com', '5412879', '12458179','4578758','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Chandler', 'Valdez', '1970-12-06'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741849', '1-5478789', '9812346009', 'chandler_valdez@gmail.com', 'www.chandler.com', '5412880', '12458180','4578759','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Amir', 'Hubbard', '1970-12-07'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741850', '1-5478790', '9812346010', 'amir_hubbard@gmail.com', 'www.amir.com', '5412881', '12458181','4578760','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Darren', 'Salazar', '1970-12-08'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741851', '1-5478791', '9812346011', 'darren_salazar@gmail.com', 'www.darren.com', '5412882', '12458182','4578761','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Albert', 'Reeves', '1970-12-09'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741852', '1-5478792', '9812346012', 'albert_reeves@gmail.com', 'www.albert.com', '5412883', '12458183','4578762','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Salvador', 'Warner', '1970-12-10'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741853', '1-5478793', '9812346013', 'salvador_warner@gmail.com', 'www.salvador.com', '5412884', '12458184','4578763','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Mekhi', 'Stevenson', '1970-12-11'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741854', '1-5478794', '9812346014', 'mekhi_stevenson@gmail.com', 'www.mekhi.com', '5412885', '12458185','4578764','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Abel', 'Burgess', '1970-12-12'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741855', '1-5478795', '9812346015', 'abel_burgess@gmail.com', 'www.abel.com', '5412886', '12458186','4578765','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Joaquin', 'Santos', '1970-12-13'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741856', '1-5478796', '9812346016', 'joaquin_santos@gmail.com', 'www.joaquin.com', '5412887', '12458187','4578766','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Caiden', 'Tate', '1970-12-14'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741857', '1-5478797', '9812346017', 'caiden_tate@gmail.com', 'www.caiden.com', '5412888', '12458188','4578767','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Jay', 'Cross', '1970-12-15'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741858', '1-5478798', '9812346018', 'jay_cross@gmail.com', 'www.jay.com', '5412889', '12458189','4578768','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Declan', 'Garner', '1970-12-16'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741859', '1-5478799', '9812346019', 'declan_garner@gmail.com', 'www.declan.com', '5412890', '12458190','4578769','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Julius', 'Mann', '1970-12-17'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741860', '1-5478800', '9812346020', 'julius_mann@gmail.com', 'www.julius.com', '5412891', '12458191','4578770','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Alfredo', 'Mack', '1970-12-18'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741861', '1-5478801', '9812346021', 'alfredo_mack@gmail.com', 'www.alfredo.com', '5412892', '12458192','4578771','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Camron', 'Moss', '1970-12-19'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741862', '1-5478802', '9812346022', 'camron_moss@gmail.com', 'www.camron.com', '5412893', '12458193','4578772','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Maximilian', 'Thornton', '1970-12-20'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741863', '1-5478803', '9812346023', 'maximilian_thornton@gmail.com', 'www.maximilian.com', '5412894', '12458194','4578773','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Arthur', 'Dennis', '1970-12-21'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741864', '1-5478804', '9812346024', 'arthur_dennis@gmail.com', 'www.arthur.com', '5412895', '12458195','4578774','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Holden', 'Mcgee', '1970-12-22'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741865', '1-5478805', '9812346025', 'holden_mcgee@gmail.com', 'www.holden.com', '5412896', '12458196','4578775','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Larry', 'Farmer', '1970-12-23'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741866', '1-5478806', '9812346026', 'larry_farmer@gmail.com', 'www.larry.com', '5412897', '12458197','4578776','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Ezra', 'Delgado', '1970-12-24'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741867', '1-5478807', '9812346027', 'ezra_delgado@gmail.com', 'www.ezra.com', '5412898', '12458198','4578777','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Moises', 'Aguilar', '1970-12-25'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741868', '1-5478808', '9812346028', 'moises_aguilar@gmail.com', 'www.moises.com', '5412899', '12458199','4578778','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Douglas', 'Vega', '1970-12-26'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741869', '1-5478809', '9812346029', 'douglas_vega@gmail.com', 'www.douglas.com', '5412900', '12458200','4578779','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Orlando', 'Glover', '1970-12-27'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741870', '1-5478810', '9812346030', 'orlando_glover@gmail.com', 'www.orlando.com', '5412901', '12458201','4578780','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Keaton', 'Manning', '1970-12-28'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741871', '1-5478811', '9812346031', 'keaton_manning@gmail.com', 'www.keaton.com', '5412902', '12458202','4578781','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Braylon', 'Cohen', '1970-12-29'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741872', '1-5478812', '9812346032', 'braylon_cohen@gmail.com', 'www.braylon.com', '5412903', '12458203','4578782','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Ramon', 'Harmon', '1970-12-30'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741873', '1-5478813', '9812346033', 'ramon_harmon@gmail.com', 'www.ramon.com', '5412904', '12458204','4578783','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Bryant', 'Rodgers', '1970-12-31'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741874', '1-5478814', '9812346034', 'bryant_rodgers@gmail.com', 'www.bryant.com', '5412905', '12458205','4578784','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Dallas', 'Robbins', '1971-01-01'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741875', '1-5478815', '9812346035', 'dallas_robbins@gmail.com', 'www.dallas.com', '5412906', '12458206','4578785','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Walker', 'Newton', '1971-01-02'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741876', '1-5478816', '9812346036', 'walker_newton@gmail.com', 'www.walker.com', '5412907', '12458207','4578786','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Mauricio', 'Todd', '1971-01-03'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741877', '1-5478817', '9812346037', 'mauricio_todd@gmail.com', 'www.mauricio.com', '5412908', '12458208','4578787','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Marvin', 'Blair', '1971-01-04'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741878', '1-5478818', '9812346038', 'marvin_blair@gmail.com', 'www.marvin.com', '5412909', '12458209','4578788','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Ernesto', 'Higgins', '1971-01-05'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741879', '1-5478819', '9812346039', 'ernesto_higgins@gmail.com', 'www.ernesto.com', '5412910', '12458210','4578789','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Hugo', 'Ingram', '1971-01-06'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741880', '1-5478820', '9812346040', 'hugo_ingram@gmail.com', 'www.hugo.com', '5412911', '12458211','4578790','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Joe', 'Reese', '1971-01-07'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741881', '1-5478821', '9812346041', 'joe_reese@gmail.com', 'www.joe.com', '5412912', '12458212','4578791','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Reece', 'Cannon', '1971-01-08'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741882', '1-5478822', '9812346042', 'reece_cannon@gmail.com', 'www.reece.com', '5412913', '12458213','4578792','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Felix', 'Strickland', '1971-01-09'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741883', '1-5478823', '9812346043', 'felix_strickland@gmail.com', 'www.felix.com', '5412914', '12458214','4578793','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Yahir', 'Townsend', '1971-01-10'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741884', '1-5478824', '9812346044', 'yahir_townsend@gmail.com', 'www.yahir.com', '5412915', '12458215','4578794','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Walter', 'Potter', '1971-01-11'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741885', '1-5478825', '9812346045', 'walter_potter@gmail.com', 'www.walter.com', '5412916', '12458216','4578795','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Cory', 'Goodwin', '1971-01-12'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741886', '1-5478826', '9812346046', 'cory_goodwin@gmail.com', 'www.cory.com', '5412917', '12458217','4578796','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Tate', 'Walton', '1971-01-13'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741887', '1-5478827', '9812346047', 'tate_walton@gmail.com', 'www.tate.com', '5412918', '12458218','4578797','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Ricky', 'Rowe', '1971-01-14'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741888', '1-5478828', '9812346048', 'ricky_rowe@gmail.com', 'www.ricky.com', '5412919', '12458219','4578798','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Chad', 'Hampton', '1971-01-15'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741889', '1-5478829', '9812346049', 'chad_hampton@gmail.com', 'www.chad.com', '5412920', '12458220','4578799','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Maximus', 'Ortega', '1971-01-16'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741890', '1-5478830', '9812346050', 'maximus_ortega@gmail.com', 'www.maximus.com', '5412921', '12458221','4578800','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Dean', 'Patton', '1971-01-17'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741891', '1-5478831', '9812346051', 'dean_patton@gmail.com', 'www.dean.com', '5412922', '12458222','4578801','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Marc', 'Swanson', '1971-01-18'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741892', '1-5478832', '9812346052', 'marc_swanson@gmail.com', 'www.marc.com', '5412923', '12458223','4578802','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Braydon', 'Joseph', '1971-01-19'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741893', '1-5478833', '9812346053', 'braydon_joseph@gmail.com', 'www.braydon.com', '5412924', '12458224','4578803','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Ali', 'Francis', '1971-01-20'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741894', '1-5478834', '9812346054', 'ali_francis@gmail.com', 'www.ali.com', '5412925', '12458225','4578804','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Elliot', 'Goodman', '1971-01-21'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741895', '1-5478835', '9812346055', 'elliot_goodman@gmail.com', 'www.elliot.com', '5412926', '12458226','4578805','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Jonas', 'Maldonado', '1971-01-22'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741896', '1-5478836', '9812346056', 'jonas_maldonado@gmail.com', 'www.jonas.com', '5412927', '12458227','4578806','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Weston', 'Yates', '1971-01-23'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741897', '1-5478837', '9812346057', 'weston_yates@gmail.com', 'www.weston.com', '5412928', '12458228','4578807','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Jaxson', 'Becker', '1971-01-24'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741898', '1-5478838', '9812346058', 'jaxson_becker@gmail.com', 'www.jaxson.com', '5412929', '12458229','4578808','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Isiah', 'Erickson', '1971-01-25'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741899', '1-5478839', '9812346059', 'isiah_erickson@gmail.com', 'www.isiah.com', '5412930', '12458230','4578809','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Rodrigo', 'Hodges', '1971-01-26'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741900', '1-5478840', '9812346060', 'rodrigo_hodges@gmail.com', 'www.rodrigo.com', '5412931', '12458231','4578810','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Davis', 'Rios', '1971-01-27'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741901', '1-5478841', '9812346061', 'davis_rios@gmail.com', 'www.davis.com', '5412932', '12458232','4578811','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Easton', 'Conner', '1971-01-28'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741902', '1-5478842', '9812346062', 'easton_conner@gmail.com', 'www.easton.com', '5412933', '12458233','4578812','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Russell', 'Adkins', '1971-01-29'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741903', '1-5478843', '9812346063', 'russell_adkins@gmail.com', 'www.russell.com', '5412934', '12458234','4578813','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Bennett', 'Webster', '1971-01-30'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741904', '1-5478844', '9812346064', 'bennett_webster@gmail.com', 'www.bennett.com', '5412935', '12458235','4578814','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Lawrence', 'Norman', '1971-01-31'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741905', '1-5478845', '9812346065', 'lawrence_norman@gmail.com', 'www.lawrence.com', '5412936', '12458236','4578815','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Chris', 'Malone', '1971-02-01'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741906', '1-5478846', '9812346066', 'chris_malone@gmail.com', 'www.chris.com', '5412937', '12458237','4578816','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Shaun', 'Hammond', '1971-02-02'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741907', '1-5478847', '9812346067', 'shaun_hammond@gmail.com', 'www.shaun.com', '5412938', '12458238','4578817','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Nasir', 'Flowers', '1971-02-03'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741908', '1-5478848', '9812346068', 'nasir_flowers@gmail.com', 'www.nasir.com', '5412939', '12458239','4578818','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Kristopher', 'Cobb', '1971-02-04'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741909', '1-5478849', '9812346069', 'kristopher_cobb@gmail.com', 'www.kristopher.com', '5412940', '12458240','4578819','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Luca', 'Moody', '1971-02-05'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741910', '1-5478850', '9812346070', 'luca_moody@gmail.com', 'www.luca.com', '5412941', '12458241','4578820','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Uriel', 'Quinn', '1971-02-06'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741911', '1-5478851', '9812346071', 'uriel_quinn@gmail.com', 'www.uriel.com', '5412942', '12458242','4578821','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Eddie', 'Blake', '1971-02-07'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741912', '1-5478852', '9812346072', 'eddie_blake@gmail.com', 'www.eddie.com', '5412943', '12458243','4578822','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Javon', 'Maxwell', '1971-02-08'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741913', '1-5478853', '9812346073', 'javon_maxwell@gmail.com', 'www.javon.com', '5412944', '12458244','4578823','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Issac', 'Pope', '1971-02-09'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741914', '1-5478854', '9812346074', 'issac_pope@gmail.com', 'www.issac.com', '5412945', '12458245','4578824','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Reese', 'Floyd', '1971-02-10'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741915', '1-5478855', '9812346075', 'reese_floyd@gmail.com', 'www.reese.com', '5412946', '12458246','4578825','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Terry', 'Osborne', '1971-02-11'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741916', '1-5478856', '9812346076', 'terry_osborne@gmail.com', 'www.terry.com', '5412947', '12458247','4578826','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Micheal', 'Paul', '1971-02-12'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741917', '1-5478857', '9812346077', 'micheal_paul@gmail.com', 'www.micheal.com', '5412948', '12458248','4578827','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Graham', 'Mccarthy', '1971-02-13'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741918', '1-5478858', '9812346078', 'graham_mccarthy@gmail.com', 'www.graham.com', '5412949', '12458249','4578828','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Amari', 'Guerrero', '1971-02-14'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741919', '1-5478859', '9812346079', 'amari_guerrero@gmail.com', 'www.amari.com', '5412950', '12458250','4578829','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Zachariah', 'Lindsey', '1971-02-15'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741920', '1-5478860', '9812346080', 'zachariah_lindsey@gmail.com', 'www.zachariah.com', '5412951', '12458251','4578830','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Silas', 'Estrada', '1971-02-16'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741921', '1-5478861', '9812346081', 'silas_estrada@gmail.com', 'www.silas.com', '5412952', '12458252','4578831','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Carl', 'Sandoval', '1971-02-17'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741922', '1-5478862', '9812346082', 'carl_sandoval@gmail.com', 'www.carl.com', '5412953', '12458253','4578832','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Maurice', 'Gibbs', '1971-02-18'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741923', '1-5478863', '9812346083', 'maurice_gibbs@gmail.com', 'www.maurice.com', '5412954', '12458254','4578833','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Kade', 'Tyler', '1971-02-19'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741924', '1-5478864', '9812346084', 'kade_tyler@gmail.com', 'www.kade.com', '5412955', '12458255','4578834','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Elliott', 'Gross', '1971-02-20'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741925', '1-5478865', '9812346085', 'elliott_gross@gmail.com', 'www.elliott.com', '5412956', '12458256','4578835','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Roger', 'Fitzgerald', '1971-02-21'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741926', '1-5478866', '9812346086', 'roger_fitzgerald@gmail.com', 'www.roger.com', '5412957', '12458257','4578836','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Jamarion', 'Doyle', '1971-02-23'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741928', '1-5478868', '9812346088', 'jamarion_doyle@gmail.com', 'www.jamarion.com', '5412959', '12458259','4578838','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Omarion', 'Sherman', '1971-02-24'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741929', '1-5478869', '9812346089', 'omarion_sherman@gmail.com', 'www.omarion.com', '5412960', '12458260','4578839','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Leonel', 'Saunders', '1971-02-25'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741930', '1-5478870', '9812346090', 'leonel_saunders@gmail.com', 'www.leonel.com', '5412961', '12458261','4578840','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Marshall', 'Wise', '1971-02-26'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741931', '1-5478871', '9812346091', 'marshall_wise@gmail.com', 'www.marshall.com', '5412962', '12458262','4578841','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Reid', 'Colon', '1971-02-27'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741932', '1-5478872', '9812346092', 'reid_colon@gmail.com', 'www.reid.com', '5412963', '12458263','4578842','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Jadon', 'Gill', '1971-02-28'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741933', '1-5478873', '9812346093', 'jadon_gill@gmail.com', 'www.jadon.com', '5412964', '12458264','4578843','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Jamari', 'Alvarado', '1971-03-01'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741934', '1-5478874', '9812346094', 'jamari_alvarado@gmail.com', 'www.jamari.com', '5412965', '12458265','4578844','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Dorian', 'Greer', '1971-03-02'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741935', '1-5478875', '9812346095', 'dorian_greer@gmail.com', 'www.dorian.com', '5412966', '12458266','4578845','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Noe', 'Padilla', '1971-03-03'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741936', '1-5478876', '9812346096', 'noe_padilla@gmail.com', 'www.noe.com', '5412967', '12458267','4578846','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Tommy', 'Simon', '1971-03-04'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741937', '1-5478877', '9812346097', 'tommy_simon@gmail.com', 'www.tommy.com', '5412968', '12458268','4578847','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Todd', 'Kemp', '1971-08-11'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742097', '1-5479037', '9812346257', 'todd_kemp@gmail.com', 'www.todd.com', '5413128', '12458428','4579007','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Zachery', 'Waters', '1971-03-05'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741938', '1-5478878', '9812346098', 'zachery_waters@gmail.com', 'www.zachery.com', '5412969', '12458269','4578848','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Davion', 'Nunez', '1971-03-06'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741939', '1-5478879', '9812346099', 'davion_nunez@gmail.com', 'www.davion.com', '5412970', '12458270','4578849','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Kelvin', 'Ballard', '1971-03-07'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741940', '1-5478880', '9812346100', 'kelvin_ballard@gmail.com', 'www.kelvin.com', '5412971', '12458271','4578850','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Cohen', 'Schwartz', '1971-03-08'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741941', '1-5478881', '9812346101', 'cohen_schwartz@gmail.com', 'www.cohen.com', '5412972', '12458272','4578851','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Jon', 'Mcbride', '1971-03-09'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741942', '1-5478882', '9812346102', 'jon_mcbride@gmail.com', 'www.jon.com', '5412973', '12458273','4578852','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Melvin', 'Houston', '1971-03-10'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741943', '1-5478883', '9812346103', 'melvin_houston@gmail.com', 'www.melvin.com', '5412974', '12458274','4578853','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Guillermo', 'Christensen', '1971-03-11'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741944', '1-5478884', '9812346104', 'guillermo_christensen@gmail.com', 'www.guillermo.com', '5412975', '12458275','4578854','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Jaylin', 'Klein', '1971-03-12'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741945', '1-5478885', '9812346105', 'jaylin_klein@gmail.com', 'www.jaylin.com', '5412976', '12458276','4578855','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Jeffery', 'Pratt', '1971-03-13'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741946', '1-5478886', '9812346106', 'jeffery_pratt@gmail.com', 'www.jeffery.com', '5412977', '12458277','4578856','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Jaydon', 'Briggs', '1971-03-14'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741947', '1-5478887', '9812346107', 'jaydon_briggs@gmail.com', 'www.jaydon.com', '5412978', '12458278','4578857','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Nelson', 'Parsons', '1971-03-15'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741948', '1-5478888', '9812346108', 'nelson_parsons@gmail.com', 'www.nelson.com', '5412979', '12458279','4578858','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Deandre', 'Mclaughlin', '1971-03-16'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741949', '1-5478889', '9812346109', 'deandre_mclaughlin@gmail.com', 'www.deandre.com', '5412980', '12458280','4578859','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Rowan', 'Zimmerman', '1971-03-17'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741950', '1-5478890', '9812346110', 'rowan_zimmerman@gmail.com', 'www.rowan.com', '5412981', '12458281','4578860','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Noel', 'French', '1971-03-18'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741951', '1-5478891', '9812346111', 'noel_french@gmail.com', 'www.noel.com', '5412982', '12458282','4578861','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Justice', 'Buchanan', '1971-03-19'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741952', '1-5478892', '9812346112', 'justice_buchanan@gmail.com', 'www.justice.com', '5412983', '12458283','4578862','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Branden', 'Moran', '1971-03-20'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741953', '1-5478893', '9812346113', 'branden_moran@gmail.com', 'www.branden.com', '5412984', '12458284','4578863','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Felipe', 'Copeland', '1971-03-21'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741954', '1-5478894', '9812346114', 'felipe_copeland@gmail.com', 'www.felipe.com', '5412985', '12458285','4578864','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Jessie', 'Roy', '1971-03-22'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741955', '1-5478895', '9812346115', 'jessie_roy@gmail.com', 'www.jessie.com', '5412986', '12458286','4578865','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Kristian', 'Pittman', '1971-03-23'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741956', '1-5478896', '9812346116', 'kristian_pittman@gmail.com', 'www.kristian.com', '5412987', '12458287','4578866','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Rodney', 'Brady', '1971-03-24'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741957', '1-5478897', '9812346117', 'rodney_brady@gmail.com', 'www.rodney.com', '5412988', '12458288','4578867','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Jermaine', 'Mccormick', '1971-03-25'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741958', '1-5478898', '9812346118', 'jermaine_mccormick@gmail.com', 'www.jermaine.com', '5412989', '12458289','4578868','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Frederick', 'Holloway', '1971-03-26'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741959', '1-5478899', '9812346119', 'frederick_holloway@gmail.com', 'www.frederick.com', '5412990', '12458290','4578869','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Nathanael', 'Brock', '1971-03-27'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741960', '1-5478900', '9812346120', 'nathanael_brock@gmail.com', 'www.nathanael.com', '5412991', '12458291','4578870','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Franklin', 'Poole', '1971-03-28'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741961', '1-5478901', '9812346121', 'franklin_poole@gmail.com', 'www.franklin.com', '5412992', '12458292','4578871','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Dane', 'Frank', '1971-03-29'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741962', '1-5478902', '9812346122', 'dane_frank@gmail.com', 'www.dane.com', '5412993', '12458293','4578872','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Khalil', 'Logan', '1971-03-30'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741963', '1-5478903', '9812346123', 'khalil_logan@gmail.com', 'www.khalil.com', '5412994', '12458294','4578873','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Brent', 'Owen', '1971-03-31'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741964', '1-5478904', '9812346124', 'brent_owen@gmail.com', 'www.brent.com', '5412995', '12458295','4578874','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Billy', 'Bass', '1971-04-01'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741965', '1-5478905', '9812346125', 'billy_bass@gmail.com', 'www.billy.com', '5412996', '12458296','4578875','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Jayce', 'Marsh', '1971-04-02'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741966', '1-5478906', '9812346126', 'jayce_marsh@gmail.com', 'www.jayce.com', '5412997', '12458297','4578876','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Terrance', 'Drake', '1971-04-03'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741967', '1-5478907', '9812346127', 'terrance_drake@gmail.com', 'www.terrance.com', '5412998', '12458298','4578877','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Kenny', 'Wong', '1971-04-04'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741968', '1-5478908', '9812346128', 'kenny_wong@gmail.com', 'www.kenny.com', '5412999', '12458299','4578878','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Quinton', 'Jefferson', '1971-04-05'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741969', '1-5478909', '9812346129', 'quinton_jefferson@gmail.com', 'www.quinton.com', '5413000', '12458300','4578879','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Allan', 'Park', '1971-04-06'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741970', '1-5478910', '9812346130', 'allan_park@gmail.com', 'www.allan.com', '5413001', '12458301','4578880','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Skylar', 'Morton', '1971-04-07'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741971', '1-5478911', '9812346131', 'skylar_morton@gmail.com', 'www.skylar.com', '5413002', '12458302','4578881','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Sam', 'Abbott', '1971-04-08'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741972', '1-5478912', '9812346132', 'sam_abbott@gmail.com', 'www.sam.com', '5413003', '12458303','4578882','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Jamal', 'Sparks', '1971-04-09'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741973', '1-5478913', '9812346133', 'jamal_sparks@gmail.com', 'www.jamal.com', '5413004', '12458304','4578883','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Rogelio', 'Patrick', '1971-04-10'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741974', '1-5478914', '9812346134', 'rogelio_patrick@gmail.com', 'www.rogelio.com', '5413005', '12458305','4578884','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Nehemiah', 'Norton', '1971-04-11'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741975', '1-5478915', '9812346135', 'nehemiah_norton@gmail.com', 'www.nehemiah.com', '5413006', '12458306','4578885','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Quincy', 'Huff', '1971-04-12'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741976', '1-5478916', '9812346136', 'quincy_huff@gmail.com', 'www.quincy.com', '5413007', '12458307','4578886','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Izaiah', 'Clayton', '1971-04-13'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741977', '1-5478917', '9812346137', 'izaiah_clayton@gmail.com', 'www.izaiah.com', '5413008', '12458308','4578887','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Ahmad', 'Massey', '1971-04-14'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741978', '1-5478918', '9812346138', 'ahmad_massey@gmail.com', 'www.ahmad.com', '5413009', '12458309','4578888','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Reed', 'Lloyd', '1971-04-15'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741979', '1-5478919', '9812346139', 'reed_lloyd@gmail.com', 'www.reed.com', '5413010', '12458310','4578889','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Roy', 'Figueroa', '1971-04-16'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741980', '1-5478920', '9812346140', 'roy_figueroa@gmail.com', 'www.roy.com', '5413011', '12458311','4578890','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Brendon', 'Carson', '1971-04-17'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741981', '1-5478921', '9812346141', 'brendon_carson@gmail.com', 'www.brendon.com', '5413012', '12458312','4578891','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Desmond', 'Bowers', '1971-04-18'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741982', '1-5478922', '9812346142', 'desmond_bowers@gmail.com', 'www.desmond.com', '5413013', '12458313','4578892','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Rene', 'Roberson', '1971-04-19'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741983', '1-5478923', '9812346143', 'rene_roberson@gmail.com', 'www.rene.com', '5413014', '12458314','4578893','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Mohamed', 'Barton', '1971-04-20'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741984', '1-5478924', '9812346144', 'mohamed_barton@gmail.com', 'www.mohamed.com', '5413015', '12458315','4578894','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Kody', 'Tran', '1971-04-21'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741985', '1-5478925', '9812346145', 'kody_tran@gmail.com', 'www.kody.com', '5413016', '12458316','4578895','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Osvaldo', 'Lamb', '1971-04-22'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741986', '1-5478926', '9812346146', 'osvaldo_lamb@gmail.com', 'www.osvaldo.com', '5413017', '12458317','4578896','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Phoenix', 'Harrington', '1971-04-23'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741987', '1-5478927', '9812346147', 'phoenix_harrington@gmail.com', 'www.phoenix.com', '5413018', '12458318','4578897','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Toby', 'Casey', '1971-04-24'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741988', '1-5478928', '9812346148', 'toby_casey@gmail.com', 'www.toby.com', '5413019', '12458319','4578898','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Jaylon', 'Boone', '1971-04-25'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741989', '1-5478929', '9812346149', 'jaylon_boone@gmail.com', 'www.jaylon.com', '5413020', '12458320','4578899','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Wilson', 'Cortez', '1971-04-26'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741990', '1-5478930', '9812346150', 'wilson_cortez@gmail.com', 'www.wilson.com', '5413021', '12458321','4578900','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Terrell', 'Clarke', '1971-04-27'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741991', '1-5478931', '9812346151', 'terrell_clarke@gmail.com', 'www.terrell.com', '5413022', '12458322','4578901','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Jameson', 'Mathis', '1971-04-28'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741992', '1-5478932', '9812346152', 'jameson_mathis@gmail.com', 'www.jameson.com', '5413023', '12458323','4578902','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Conor', 'Singleton', '1971-04-29'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741993', '1-5478933', '9812346153', 'conor_singleton@gmail.com', 'www.conor.com', '5413024', '12458324','4578903','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Alvin', 'Wilkins', '1971-04-30'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741994', '1-5478934', '9812346154', 'alvin_wilkins@gmail.com', 'www.alvin.com', '5413025', '12458325','4578904','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Solomon', 'Cain', '1971-05-01'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741995', '1-5478935', '9812346155', 'solomon_cain@gmail.com', 'www.solomon.com', '5413026', '12458326','4578905','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Tomas', 'Bryan', '1971-05-02'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741996', '1-5478936', '9812346156', 'tomas_bryan@gmail.com', 'www.tomas.com', '5413027', '12458327','4578906','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Tobias', 'Underwood', '1971-05-03'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741997', '1-5478937', '9812346157', 'tobias_underwood@gmail.com', 'www.tobias.com', '5413028', '12458328','4578907','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Triston', 'Hogan', '1971-05-04'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741998', '1-5478938', '9812346158', 'triston_hogan@gmail.com', 'www.triston.com', '5413029', '12458329','4578908','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Bobby', 'Mckenzie', '1971-05-05'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5741999', '1-5478939', '9812346159', 'bobby_mckenzie@gmail.com', 'www.bobby.com', '5413030', '12458330','4578909','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Pierce', 'Collier', '1971-05-06'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742000', '1-5478940', '9812346160', 'pierce_collier@gmail.com', 'www.pierce.com', '5413031', '12458331','4578910','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Lincoln', 'Luna', '1971-05-07'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742001', '1-5478941', '9812346161', 'lincoln_luna@gmail.com', 'www.lincoln.com', '5413032', '12458332','4578911','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Byron', 'Phelps', '1971-05-08'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742002', '1-5478942', '9812346162', 'byron_phelps@gmail.com', 'www.byron.com', '5413033', '12458333','4578912','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Cyrus', 'Mcguire', '1971-05-09'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742003', '1-5478943', '9812346163', 'cyrus_mcguire@gmail.com', 'www.cyrus.com', '5413034', '12458334','4578913','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Rodolfo', 'Allison', '1971-05-10'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742004', '1-5478944', '9812346164', 'rodolfo_allison@gmail.com', 'www.rodolfo.com', '5413035', '12458335','4578914','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Trevon', 'Bridges', '1971-05-11'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742005', '1-5478945', '9812346165', 'trevon_bridges@gmail.com', 'www.trevon.com', '5413036', '12458336','4578915','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Will', 'Wilkerson', '1971-05-12'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742006', '1-5478946', '9812346166', 'will_wilkerson@gmail.com', 'www.will.com', '5413037', '12458337','4578916','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Rohan', 'Nash', '1971-05-13'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742007', '1-5478947', '9812346167', 'rohan_nash@gmail.com', 'www.rohan.com', '5413038', '12458338','4578917','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Demetrius', 'Summers', '1971-05-14'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742008', '1-5478948', '9812346168', 'demetrius_summers@gmail.com', 'www.demetrius.com', '5413039', '12458339','4578918','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Craig', 'Atkins', '1971-05-15'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742009', '1-5478949', '9812346169', 'craig_atkins@gmail.com', 'www.craig.com', '5413040', '12458340','4578919','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Anderson', 'Wilcox', '1971-05-16'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742010', '1-5478950', '9812346170', 'anderson_wilcox@gmail.com', 'www.anderson.com', '5413041', '12458341','4578920','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Zackery', 'Pitts', '1971-05-17'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742011', '1-5478951', '9812346171', 'zackery_pitts@gmail.com', 'www.zackery.com', '5413042', '12458342','4578921','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Bruce', 'Conley', '1971-05-18'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742012', '1-5478952', '9812346172', 'bruce_conley@gmail.com', 'www.bruce.com', '5413043', '12458343','4578922','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Reginald', 'Marquez', '1971-05-19'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742013', '1-5478953', '9812346173', 'reginald_marquez@gmail.com', 'www.reginald.com', '5413044', '12458344','4578923','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Adolfo', 'Burnett', '1971-05-20'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742014', '1-5478954', '9812346174', 'adolfo_burnett@gmail.com', 'www.adolfo.com', '5413045', '12458345','4578924','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Damion', 'Richard', '1971-05-21'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742015', '1-5478955', '9812346175', 'damion_richard@gmail.com', 'www.damion.com', '5413046', '12458346','4578925','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Wade', 'Cochran', '1971-05-22'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742016', '1-5478956', '9812346176', 'wade_cochran@gmail.com', 'www.wade.com', '5413047', '12458347','4578926','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Jett', 'Chase', '1971-05-23'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742017', '1-5478957', '9812346177', 'jett_chase@gmail.com', 'www.jett.com', '5413048', '12458348','4578927','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Harley', 'Davenport', '1971-05-24'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742018', '1-5478958', '9812346178', 'harley_davenport@gmail.com', 'www.harley.com', '5413049', '12458349','4578928','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Joey', 'Hood', '1971-05-25'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742019', '1-5478959', '9812346179', 'joey_hood@gmail.com', 'www.joey.com', '5413050', '12458350','4578929','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Marlon', 'Gates', '1971-05-26'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742020', '1-5478960', '9812346180', 'marlon_gates@gmail.com', 'www.marlon.com', '5413051', '12458351','4578930','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Bailey', 'Clay', '1971-05-27'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742021', '1-5478961', '9812346181', 'bailey_clay@gmail.com', 'www.bailey.com', '5413052', '12458352','4578931','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Isaias', 'Ayala', '1971-05-28'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742022', '1-5478962', '9812346182', 'isaias_ayala@gmail.com', 'www.isaias.com', '5413053', '12458353','4578932','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Karl', 'Berg', '1972-01-29'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742268', '1-5479208', '9812346428', 'karl_berg@gmail.com', 'www.karl.com', '5413299', '12458599','4579178','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Steve', 'Sawyer', '1971-05-29'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742023', '1-5478963', '9812346183', 'steve_sawyer@gmail.com', 'www.steve.com', '5413054', '12458354','4578933','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Cruz', 'Roman', '1971-05-30'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742024', '1-5478964', '9812346184', 'cruz_roman@gmail.com', 'www.cruz.com', '5413055', '12458355','4578934','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'River', 'Vazquez', '1971-05-31'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742025', '1-5478965', '9812346185', 'river_vazquez@gmail.com', 'www.river.com', '5413056', '12458356','4578935','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Willie', 'Dickerson', '1971-06-01'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742026', '1-5478966', '9812346186', 'willie_dickerson@gmail.com', 'www.willie.com', '5413057', '12458357','4578936','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Kellen', 'Hodge', '1971-06-02'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742027', '1-5478967', '9812346187', 'kellen_hodge@gmail.com', 'www.kellen.com', '5413058', '12458358','4578937','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Gerald', 'Acosta', '1971-06-03'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742028', '1-5478968', '9812346188', 'gerald_acosta@gmail.com', 'www.gerald.com', '5413059', '12458359','4578938','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Grady', 'Flynn', '1971-06-04'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742029', '1-5478969', '9812346189', 'grady_flynn@gmail.com', 'www.grady.com', '5413060', '12458360','4578939','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Blaine', 'Espinoza', '1971-06-05'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742030', '1-5478970', '9812346190', 'blaine_espinoza@gmail.com', 'www.blaine.com', '5413061', '12458361','4578940','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Kendall', 'Nicholson', '1971-06-06'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742031', '1-5478971', '9812346191', 'kendall_nicholson@gmail.com', 'www.kendall.com', '5413062', '12458362','4578941','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Judah', 'Monroe', '1971-06-07'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742032', '1-5478972', '9812346192', 'judah_monroe@gmail.com', 'www.judah.com', '5413063', '12458363','4578942','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Leon', 'Wolf', '1971-06-08'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742033', '1-5478973', '9812346193', 'leon_wolf@gmail.com', 'www.leon.com', '5413064', '12458364','4578943','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Marquis', 'Morrow', '1971-06-09'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742034', '1-5478974', '9812346194', 'marquis_morrow@gmail.com', 'www.marquis.com', '5413065', '12458365','4578944','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Harry', 'Kirk', '1971-06-10'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742035', '1-5478975', '9812346195', 'harry_kirk@gmail.com', 'www.harry.com', '5413066', '12458366','4578945','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Francis', 'Randall', '1971-06-11'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742036', '1-5478976', '9812346196', 'francis_randall@gmail.com', 'www.francis.com', '5413067', '12458367','4578946','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Deven', 'Anthony', '1971-06-12'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742037', '1-5478977', '9812346197', 'deven_anthony@gmail.com', 'www.deven.com', '5413068', '12458368','4578947','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Gilberto', 'Whitaker', '1971-06-13'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742038', '1-5478978', '9812346198', 'gilberto_whitaker@gmail.com', 'www.gilberto.com', '5413069', '12458369','4578948','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Alfonso', 'Oconnor', '1971-06-14'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742039', '1-5478979', '9812346199', 'alfonso_oconnor@gmail.com', 'www.alfonso.com', '5413070', '12458370','4578949','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Everett', 'Skinner', '1971-06-15'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742040', '1-5478980', '9812346200', 'everett_skinner@gmail.com', 'www.everett.com', '5413071', '12458371','4578950','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Dayton', 'Ware', '1971-06-16'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742041', '1-5478981', '9812346201', 'dayton_ware@gmail.com', 'www.dayton.com', '5413072', '12458372','4578951','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Johnathon', 'Molina', '1971-06-17'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742042', '1-5478982', '9812346202', 'johnathon_molina@gmail.com', 'www.johnathon.com', '5413073', '12458373','4578952','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Alonzo', 'Kirby', '1971-06-18'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742043', '1-5478983', '9812346203', 'alonzo_kirby@gmail.com', 'www.alonzo.com', '5413074', '12458374','4578953','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Malcolm', 'Huffman', '1971-06-19'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742044', '1-5478984', '9812346204', 'malcolm_huffman@gmail.com', 'www.malcolm.com', '5413075', '12458375','4578954','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Moses', 'Bradford', '1971-06-20'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742045', '1-5478985', '9812346205', 'moses_bradford@gmail.com', 'www.moses.com', '5413076', '12458376','4578955','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Finn', 'Charles', '1971-06-21'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742046', '1-5478986', '9812346206', 'finn_charles@gmail.com', 'www.finn.com', '5413077', '12458377','4578956','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Gunnar', 'Gilmore', '1971-06-22'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742047', '1-5478987', '9812346207', 'gunnar_gilmore@gmail.com', 'www.gunnar.com', '5413078', '12458378','4578957','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Jasper', 'Dominguez', '1971-06-23'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742048', '1-5478988', '9812346208', 'jasper_dominguez@gmail.com', 'www.jasper.com', '5413079', '12458379','4578958','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Kobe', 'Oneal', '1971-06-24'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742049', '1-5478989', '9812346209', 'kobe_oneal@gmail.com', 'www.kobe.com', '5413080', '12458380','4578959','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Johan', 'Bruce', '1971-06-25'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742050', '1-5478990', '9812346210', 'johan_bruce@gmail.com', 'www.johan.com', '5413081', '12458381','4578960','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Talan', 'Lang', '1971-06-26'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742051', '1-5478991', '9812346211', 'talan_lang@gmail.com', 'www.talan.com', '5413082', '12458382','4578961','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Ben', 'Combs', '1971-06-27'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742052', '1-5478992', '9812346212', 'ben_combs@gmail.com', 'www.ben.com', '5413083', '12458383','4578962','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Trace', 'Kramer', '1971-06-28'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742053', '1-5478993', '9812346213', 'trace_kramer@gmail.com', 'www.trace.com', '5413084', '12458384','4578963','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Ulises', 'Heath', '1971-06-29'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742054', '1-5478994', '9812346214', 'ulises_heath@gmail.com', 'www.ulises.com', '5413085', '12458385','4578964','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Ezequiel', 'Hancock', '1971-06-30'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742055', '1-5478995', '9812346215', 'ezequiel_hancock@gmail.com', 'www.ezequiel.com', '5413086', '12458386','4578965','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Titus', 'Gallagher', '1971-07-01'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742056', '1-5478996', '9812346216', 'titus_gallagher@gmail.com', 'www.titus.com', '5413087', '12458387','4578966','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Rocco', 'Gaines', '1971-07-02'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742057', '1-5478997', '9812346217', 'rocco_gaines@gmail.com', 'www.rocco.com', '5413088', '12458388','4578967','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Ariel', 'Shaffer', '1971-07-03'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742058', '1-5478998', '9812346218', 'ariel_shaffer@gmail.com', 'www.ariel.com', '5413089', '12458389','4578968','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Jamie', 'Short', '1971-07-04'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742059', '1-5478999', '9812346219', 'jamie_short@gmail.com', 'www.jamie.com', '5413090', '12458390','4578969','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Rolando', 'Wiggins', '1971-07-05'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742060', '1-5479000', '9812346220', 'rolando_wiggins@gmail.com', 'www.rolando.com', '5413091', '12458391','4578970','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Warren', 'Mathews', '1971-07-06'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742061', '1-5479001', '9812346221', 'warren_mathews@gmail.com', 'www.warren.com', '5413092', '12458392','4578971','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Kendrick', 'Mcclain', '1971-07-07'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742062', '1-5479002', '9812346222', 'kendrick_mcclain@gmail.com', 'www.kendrick.com', '5413093', '12458393','4578972','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Tristin', 'Fischer', '1971-07-08'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742063', '1-5479003', '9812346223', 'tristin_fischer@gmail.com', 'www.tristin.com', '5413094', '12458394','4578973','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Jamison', 'Wall', '1971-07-09'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742064', '1-5479004', '9812346224', 'jamison_wall@gmail.com', 'www.jamison.com', '5413095', '12458395','4578974','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Abram', 'Small', '1971-07-10'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742065', '1-5479005', '9812346225', 'abram_small@gmail.com', 'www.abram.com', '5413096', '12458396','4578975','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Ahmed', 'Melton', '1971-07-11'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742066', '1-5479006', '9812346226', 'ahmed_melton@gmail.com', 'www.ahmed.com', '5413097', '12458397','4578976','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Jairo', 'Hensley', '1971-07-12'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742067', '1-5479007', '9812346227', 'jairo_hensley@gmail.com', 'www.jairo.com', '5413098', '12458398','4578977','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Devan', 'Bond', '1971-07-13'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742068', '1-5479008', '9812346228', 'devan_bond@gmail.com', 'www.devan.com', '5413099', '12458399','4578978','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Jerome', 'Dyer', '1971-07-14'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742069', '1-5479009', '9812346229', 'jerome_dyer@gmail.com', 'www.jerome.com', '5413100', '12458400','4578979','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Orion', 'Cameron', '1971-07-15'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742070', '1-5479010', '9812346230', 'orion_cameron@gmail.com', 'www.orion.com', '5413101', '12458401','4578980','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Vicente', 'Grimes', '1971-07-16'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742071', '1-5479011', '9812346231', 'vicente_grimes@gmail.com', 'www.vicente.com', '5413102', '12458402','4578981','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Damarion', 'Contreras', '1971-07-17'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742072', '1-5479012', '9812346232', 'damarion_contreras@gmail.com', 'www.damarion.com', '5413103', '12458403','4578982','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Greyson', 'Christian', '1971-07-18'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742073', '1-5479013', '9812346233', 'greyson_christian@gmail.com', 'www.greyson.com', '5413104', '12458404','4578983','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Ray', 'Wyatt', '1971-07-19'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742074', '1-5479014', '9812346234', 'ray_wyatt@gmail.com', 'www.ray.com', '5413105', '12458405','4578984','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Gianni', 'Baxter', '1971-07-20'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742075', '1-5479015', '9812346235', 'gianni_baxter@gmail.com', 'www.gianni.com', '5413106', '12458406','4578985','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Kadin', 'Snow', '1971-07-21'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742076', '1-5479016', '9812346236', 'kadin_snow@gmail.com', 'www.kadin.com', '5413107', '12458407','4578986','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Ramiro', 'Mosley', '1971-07-22'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742077', '1-5479017', '9812346237', 'ramiro_mosley@gmail.com', 'www.ramiro.com', '5413108', '12458408','4578987','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Ronnie', 'Shepherd', '1971-07-23'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742078', '1-5479018', '9812346238', 'ronnie_shepherd@gmail.com', 'www.ronnie.com', '5413109', '12458409','4578988','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Brodie', 'Larsen', '1971-07-24'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742079', '1-5479019', '9812346239', 'brodie_larsen@gmail.com', 'www.brodie.com', '5413110', '12458410','4578989','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Stanley', 'Hoover', '1971-07-25'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742080', '1-5479020', '9812346240', 'stanley_hoover@gmail.com', 'www.stanley.com', '5413111', '12458411','4578990','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Jase', 'Beasley', '1971-07-26'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742081', '1-5479021', '9812346241', 'jase_beasley@gmail.com', 'www.jase.com', '5413112', '12458412','4578991','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Kieran', 'Glenn', '1971-07-27'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742082', '1-5479022', '9812346242', 'kieran_glenn@gmail.com', 'www.kieran.com', '5413113', '12458413','4578992','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Porter', 'Petersen', '1971-07-28'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742083', '1-5479023', '9812346243', 'porter_petersen@gmail.com', 'www.porter.com', '5413114', '12458414','4578993','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Colten', 'Whitehead', '1971-07-29'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742084', '1-5479024', '9812346244', 'colten_whitehead@gmail.com', 'www.colten.com', '5413115', '12458415','4578994','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Tyrone', 'Meyers', '1971-07-30'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742085', '1-5479025', '9812346245', 'tyrone_meyers@gmail.com', 'www.tyrone.com', '5413116', '12458416','4578995','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Terrence', 'Keith', '1971-07-31'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742086', '1-5479026', '9812346246', 'terrence_keith@gmail.com', 'www.terrence.com', '5413117', '12458417','4578996','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Darrell', 'Garrison', '1971-08-01'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742087', '1-5479027', '9812346247', 'darrell_garrison@gmail.com', 'www.darrell.com', '5413118', '12458418','4578997','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Jarrett', 'Vincent', '1971-08-02'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742088', '1-5479028', '9812346248', 'jarrett_vincent@gmail.com', 'www.jarrett.com', '5413119', '12458419','4578998','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Alvaro', 'Shields', '1971-08-03'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742089', '1-5479029', '9812346249', 'alvaro_shields@gmail.com', 'www.alvaro.com', '5413120', '12458420','4578999','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Braiden', 'Horn', '1971-08-04'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742090', '1-5479030', '9812346250', 'braiden_horn@gmail.com', 'www.braiden.com', '5413121', '12458421','4579000','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Kolby', 'Savage', '1971-08-05'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742091', '1-5479031', '9812346251', 'kolby_savage@gmail.com', 'www.kolby.com', '5413122', '12458422','4579001','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Addison', 'Olsen', '1971-08-06'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742092', '1-5479032', '9812346252', 'addison_olsen@gmail.com', 'www.addison.com', '5413123', '12458423','4579002','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Emerson', 'Schroeder', '1971-08-07'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742093', '1-5479033', '9812346253', 'emerson_schroeder@gmail.com', 'www.emerson.com', '5413124', '12458424','4579003','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Ibrahim', 'Hartman', '1971-08-08'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742094', '1-5479034', '9812346254', 'ibrahim_hartman@gmail.com', 'www.ibrahim.com', '5413125', '12458425','4579004','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Cedric', 'Woodard', '1971-08-09'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742095', '1-5479035', '9812346255', 'cedric_woodard@gmail.com', 'www.cedric.com', '5413126', '12458426','4579005','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Lee', 'Mueller', '1971-08-10'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742096', '1-5479036', '9812346256', 'lee_mueller@gmail.com', 'www.lee.com', '5413127', '12458427','4579006','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Emmett', 'Deleon', '1971-08-12'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742098', '1-5479038', '9812346258', 'emmett_deleon@gmail.com', 'www.emmett.com', '5413129', '12458429','4579008','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Keenan', 'Booth', '1971-08-13'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742099', '1-5479039', '9812346259', 'keenan_booth@gmail.com', 'www.keenan.com', '5413130', '12458430','4579009','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Leonard', 'Patel', '1971-08-14'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742100', '1-5479040', '9812346260', 'leonard_patel@gmail.com', 'www.leonard.com', '5413131', '12458431','4579010','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Alijah', 'Calhoun', '1971-08-15'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742101', '1-5479041', '9812346261', 'alijah_calhoun@gmail.com', 'www.alijah.com', '5413132', '12458432','4579011','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Davin', 'Wiley', '1971-08-16'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742102', '1-5479042', '9812346262', 'davin_wiley@gmail.com', 'www.davin.com', '5413133', '12458433','4579012','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Gilbert', 'Eaton', '1971-08-17'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742103', '1-5479043', '9812346263', 'gilbert_eaton@gmail.com', 'www.gilbert.com', '5413134', '12458434','4579013','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Karson', 'Cline', '1971-08-18'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742104', '1-5479044', '9812346264', 'karson_cline@gmail.com', 'www.karson.com', '5413135', '12458435','4579014','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Kole', 'Navarro', '1971-08-19'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742105', '1-5479045', '9812346265', 'kole_navarro@gmail.com', 'www.kole.com', '5413136', '12458436','4579015','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Quintin', 'Harrell', '1971-08-20'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742106', '1-5479046', '9812346266', 'quintin_harrell@gmail.com', 'www.quintin.com', '5413137', '12458437','4579016','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Rudy', 'Lester', '1971-08-21'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742107', '1-5479047', '9812346267', 'rudy_lester@gmail.com', 'www.rudy.com', '5413138', '12458438','4579017','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Darian', 'Humphrey', '1971-08-22'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742108', '1-5479048', '9812346268', 'darian_humphrey@gmail.com', 'www.darian.com', '5413139', '12458439','4579018','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Deshawn', 'Parrish', '1971-08-23'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742109', '1-5479049', '9812346269', 'deshawn_parrish@gmail.com', 'www.deshawn.com', '5413140', '12458440','4579019','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Aldo', 'Duran', '1971-08-24'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742110', '1-5479050', '9812346270', 'aldo_duran@gmail.com', 'www.aldo.com', '5413141', '12458441','4579020','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Neil', 'Hutchinson', '1971-08-25'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742111', '1-5479051', '9812346271', 'neil_hutchinson@gmail.com', 'www.neil.com', '5413142', '12458442','4579021','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Randall', 'Hess', '1971-08-26'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742112', '1-5479052', '9812346272', 'randall_hess@gmail.com', 'www.randall.com', '5413143', '12458443','4579022','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Cristopher', 'Dorsey', '1971-08-27'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742113', '1-5479053', '9812346273', 'cristopher_dorsey@gmail.com', 'www.cristopher.com', '5413144', '12458444','4579023','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Elisha', 'Bullock', '1971-08-28'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742114', '1-5479054', '9812346274', 'elisha_bullock@gmail.com', 'www.elisha.com', '5413145', '12458445','4579024','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Ronan', 'Robles', '1971-08-29'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742115', '1-5479055', '9812346275', 'ronan_robles@gmail.com', 'www.ronan.com', '5413146', '12458446','4579025','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Efrain', 'Beard', '1971-08-30'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742116', '1-5479056', '9812346276', 'efrain_beard@gmail.com', 'www.efrain.com', '5413147', '12458447','4579026','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Leland', 'Dalton', '1971-08-31'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742117', '1-5479057', '9812346277', 'leland_dalton@gmail.com', 'www.leland.com', '5413148', '12458448','4579027','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Davon', 'Avila', '1971-09-01'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742118', '1-5479058', '9812346278', 'davon_avila@gmail.com', 'www.davon.com', '5413149', '12458449','4579028','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Junior', 'Vance', '1971-09-02'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742119', '1-5479059', '9812346279', 'junior_vance@gmail.com', 'www.junior.com', '5413150', '12458450','4579029','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Waylon', 'Rich', '1971-09-03'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742120', '1-5479060', '9812346280', 'waylon_rich@gmail.com', 'www.waylon.com', '5413151', '12458451','4579030','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Irvin', 'Blackwell', '1971-09-04'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742121', '1-5479061', '9812346281', 'irvin_blackwell@gmail.com', 'www.irvin.com', '5413152', '12458452','4579031','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Coleman', 'York', '1971-09-05'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742122', '1-5479062', '9812346282', 'coleman_york@gmail.com', 'www.coleman.com', '5413153', '12458453','4579032','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Romeo', 'Johns', '1971-09-06'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742123', '1-5479063', '9812346283', 'romeo_johns@gmail.com', 'www.romeo.com', '5413154', '12458454','4579033','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Antoine', 'Blankenship', '1971-09-07'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742124', '1-5479064', '9812346284', 'antoine_blankenship@gmail.com', 'www.antoine.com', '5413155', '12458455','4579034','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Jaquan', 'Trevino', '1971-09-08'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742125', '1-5479065', '9812346285', 'jaquan_trevino@gmail.com', 'www.jaquan.com', '5413156', '12458456','4579035','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Camren', 'Salinas', '1971-09-09'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742126', '1-5479066', '9812346286', 'camren_salinas@gmail.com', 'www.camren.com', '5413157', '12458457','4579036','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Dominik', 'Campos', '1971-09-10'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742127', '1-5479067', '9812346287', 'dominik_campos@gmail.com', 'www.dominik.com', '5413158', '12458458','4579037','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Talon', 'Pruitt', '1971-09-11'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742128', '1-5479068', '9812346288', 'talon_pruitt@gmail.com', 'www.talon.com', '5413159', '12458459','4579038','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Gunner', 'Moses', '1971-09-12'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742129', '1-5479069', '9812346289', 'gunner_moses@gmail.com', 'www.gunner.com', '5413160', '12458460','4579039','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Kolton', 'Callahan', '1971-09-13'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742130', '1-5479070', '9812346290', 'kolton_callahan@gmail.com', 'www.kolton.com', '5413161', '12458461','4579040','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Mohammed', 'Golden', '1971-09-14'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742131', '1-5479071', '9812346291', 'mohammed_golden@gmail.com', 'www.mohammed.com', '5413162', '12458462','4579041','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Alexzander', 'Montoya', '1971-09-15'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742132', '1-5479072', '9812346292', 'alexzander_montoya@gmail.com', 'www.alexzander.com', '5413163', '12458463','4579042','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Duncan', 'Hardin', '1971-09-16'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742133', '1-5479073', '9812346293', 'duncan_hardin@gmail.com', 'www.duncan.com', '5413164', '12458464','4579043','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Jabari', 'Guerra', '1971-09-17'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742134', '1-5479074', '9812346294', 'jabari_guerra@gmail.com', 'www.jabari.com', '5413165', '12458465','4579044','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Amare', 'Mcdowell', '1971-09-18'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742135', '1-5479075', '9812346295', 'amare_mcdowell@gmail.com', 'www.amare.com', '5413166', '12458466','4579045','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Amarion', 'Carey', '1971-09-19'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742136', '1-5479076', '9812346296', 'amarion_carey@gmail.com', 'www.amarion.com', '5413167', '12458467','4579046','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Jefferson', 'Stafford', '1971-09-20'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742137', '1-5479077', '9812346297', 'jefferson_stafford@gmail.com', 'www.jefferson.com', '5413168', '12458468','4579047','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Mohammad', 'Gallegos', '1971-09-21'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742138', '1-5479078', '9812346298', 'mohammad_gallegos@gmail.com', 'www.mohammad.com', '5413169', '12458469','4579048','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Kasey', 'Henson', '1971-09-22'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742139', '1-5479079', '9812346299', 'kasey_henson@gmail.com', 'www.kasey.com', '5413170', '12458470','4579049','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Misael', 'Wilkinson', '1971-09-23'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742140', '1-5479080', '9812346300', 'misael_wilkinson@gmail.com', 'www.misael.com', '5413171', '12458471','4579050','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Brice', 'Booker', '1971-09-24'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742141', '1-5479081', '9812346301', 'brice_booker@gmail.com', 'www.brice.com', '5413172', '12458472','4579051','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Harold', 'Merritt', '1971-09-25'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742142', '1-5479082', '9812346302', 'harold_merritt@gmail.com', 'www.harold.com', '5413173', '12458473','4579052','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'August', 'Miranda', '1971-09-26'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742143', '1-5479083', '9812346303', 'august_miranda@gmail.com', 'www.august.com', '5413174', '12458474','4579053','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Brycen', 'Atkinson', '1971-09-27'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742144', '1-5479084', '9812346304', 'brycen_atkinson@gmail.com', 'www.brycen.com', '5413175', '12458475','4579054','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Draven', 'Orr', '1971-09-28'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742145', '1-5479085', '9812346305', 'draven_orr@gmail.com', 'www.draven.com', '5413176', '12458476','4579055','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Kamron', 'Decker', '1971-09-29'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742146', '1-5479086', '9812346306', 'kamron_decker@gmail.com', 'www.kamron.com', '5413177', '12458477','4579056','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Asa', 'Hobbs', '1971-09-30'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742147', '1-5479087', '9812346307', 'asa_hobbs@gmail.com', 'www.asa.com', '5413178', '12458478','4579057','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Eugene', 'Preston', '1971-10-01'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742148', '1-5479088', '9812346308', 'eugene_preston@gmail.com', 'www.eugene.com', '5413179', '12458479','4579058','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Aron', 'Tanner', '1971-10-02'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742149', '1-5479089', '9812346309', 'aron_tanner@gmail.com', 'www.aron.com', '5413180', '12458480','4579059','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Freddy', 'Knox', '1971-10-03'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742150', '1-5479090', '9812346310', 'freddy_knox@gmail.com', 'www.freddy.com', '5413181', '12458481','4579060','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Julien', 'Pacheco', '1971-10-04'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742151', '1-5479091', '9812346311', 'julien_pacheco@gmail.com', 'www.julien.com', '5413182', '12458482','4579061','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Zechariah', 'Stephenson', '1971-10-05'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742152', '1-5479092', '9812346312', 'zechariah_stephenson@gmail.com', 'www.zechariah.com', '5413183', '12458483','4579062','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Sage', 'Glass', '1971-10-06'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742153', '1-5479093', '9812346313', 'sage_glass@gmail.com', 'www.sage.com', '5413184', '12458484','4579063','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Brooks', 'Rojas', '1971-10-07'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742154', '1-5479094', '9812346314', 'brooks_rojas@gmail.com', 'www.brooks.com', '5413185', '12458485','4579064','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Dwayne', 'Serrano', '1971-10-08'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742155', '1-5479095', '9812346315', 'dwayne_serrano@gmail.com', 'www.dwayne.com', '5413186', '12458486','4579065','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Alonso', 'Marks', '1971-10-09'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742156', '1-5479096', '9812346316', 'alonso_marks@gmail.com', 'www.alonso.com', '5413187', '12458487','4579066','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Maverick', 'Hickman', '1971-10-10'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742157', '1-5479097', '9812346317', 'maverick_hickman@gmail.com', 'www.maverick.com', '5413188', '12458488','4579067','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Dashawn', 'English', '1971-10-11'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742158', '1-5479098', '9812346318', 'dashawn_english@gmail.com', 'www.dashawn.com', '5413189', '12458489','4579068','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Aydan', 'Sweeney', '1971-10-12'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742159', '1-5479099', '9812346319', 'aydan_sweeney@gmail.com', 'www.aydan.com', '5413190', '12458490','4579069','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Donte', 'Strong', '1971-10-13'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742160', '1-5479100', '9812346320', 'donte_strong@gmail.com', 'www.donte.com', '5413191', '12458491','4579070','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Tyrell', 'Prince', '1971-10-14'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742161', '1-5479101', '9812346321', 'tyrell_prince@gmail.com', 'www.tyrell.com', '5413192', '12458492','4579071','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Keagan', 'Mcclure', '1971-10-15'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742162', '1-5479102', '9812346322', 'keagan_mcclure@gmail.com', 'www.keagan.com', '5413193', '12458493','4579072','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Clay', 'Conway', '1971-10-16'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742163', '1-5479103', '9812346323', 'clay_conway@gmail.com', 'www.clay.com', '5413194', '12458494','4579073','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Ernest', 'Walter', '1971-10-17'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742164', '1-5479104', '9812346324', 'ernest_walter@gmail.com', 'www.ernest.com', '5413195', '12458495','4579074','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Octavio', 'Roth', '1971-10-18'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742165', '1-5479105', '9812346325', 'octavio_roth@gmail.com', 'www.octavio.com', '5413196', '12458496','4579075','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Brennen', 'Maynard', '1971-10-19'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742166', '1-5479106', '9812346326', 'brennen_maynard@gmail.com', 'www.brennen.com', '5413197', '12458497','4579076','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Lewis', 'Farrell', '1971-10-20'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742167', '1-5479107', '9812346327', 'lewis_farrell@gmail.com', 'www.lewis.com', '5413198', '12458498','4579077','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Layne', 'Lowery', '1971-10-21'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742168', '1-5479108', '9812346328', 'layne_lowery@gmail.com', 'www.layne.com', '5413199', '12458499','4579078','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Sincere', 'Hurst', '1971-10-22'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742169', '1-5479109', '9812346329', 'sincere_hurst@gmail.com', 'www.sincere.com', '5413200', '12458500','4579079','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Dale', 'Nixon', '1971-10-23'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742170', '1-5479110', '9812346330', 'dale_nixon@gmail.com', 'www.dale.com', '5413201', '12458501','4579080','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Kenyon', 'Weiss', '1971-10-24'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742171', '1-5479111', '9812346331', 'kenyon_weiss@gmail.com', 'www.kenyon.com', '5413202', '12458502','4579081','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Omari', 'Trujillo', '1971-10-25'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742172', '1-5479112', '9812346332', 'omari_trujillo@gmail.com', 'www.omari.com', '5413203', '12458503','4579082','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Alessandro', 'Ellison', '1971-10-26'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742173', '1-5479113', '9812346333', 'alessandro_ellison@gmail.com', 'www.alessandro.com', '5413204', '12458504','4579083','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Tyree', 'Sloan', '1971-10-27'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742174', '1-5479114', '9812346334', 'tyree_sloan@gmail.com', 'www.tyree.com', '5413205', '12458505','4579084','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Jair', 'Juarez', '1971-10-28'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742175', '1-5479115', '9812346335', 'jair_juarez@gmail.com', 'www.jair.com', '5413206', '12458506','4579085','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Demarion', 'Winters', '1971-10-29'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742176', '1-5479116', '9812346336', 'demarion_winters@gmail.com', 'www.demarion.com', '5413207', '12458507','4579086','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Oswaldo', 'Mclean', '1971-10-30'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742177', '1-5479117', '9812346337', 'oswaldo_mclean@gmail.com', 'www.oswaldo.com', '5413208', '12458508','4579087','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Raphael', 'Randolph', '1971-10-31'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742178', '1-5479118', '9812346338', 'raphael_randolph@gmail.com', 'www.raphael.com', '5413209', '12458509','4579088','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Bradyn', 'Leon', '1971-11-01'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742179', '1-5479119', '9812346339', 'bradyn_leon@gmail.com', 'www.bradyn.com', '5413210', '12458510','4579089','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Ignacio', 'Boyer', '1971-11-02'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742180', '1-5479120', '9812346340', 'ignacio_boyer@gmail.com', 'www.ignacio.com', '5413211', '12458511','4579090','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Wayne', 'Villarreal', '1971-11-03'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742181', '1-5479121', '9812346341', 'wayne_villarreal@gmail.com', 'www.wayne.com', '5413212', '12458512','4579091','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Agustin', 'Mccall', '1971-11-04'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742182', '1-5479122', '9812346342', 'agustin_mccall@gmail.com', 'www.agustin.com', '5413213', '12458513','4579092','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Cash', 'Gentry', '1971-11-05'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742183', '1-5479123', '9812346343', 'cash_gentry@gmail.com', 'www.cash.com', '5413214', '12458514','4579093','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Jordon', 'Carrillo', '1971-11-06'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742184', '1-5479124', '9812346344', 'jordon_carrillo@gmail.com', 'www.jordon.com', '5413215', '12458515','4579094','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Davian', 'Kent', '1971-11-07'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742185', '1-5479125', '9812346345', 'davian_kent@gmail.com', 'www.davian.com', '5413216', '12458516','4579095','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Xzavier', 'Ayers', '1971-11-08'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742186', '1-5479126', '9812346346', 'xzavier_ayers@gmail.com', 'www.xzavier.com', '5413217', '12458517','4579096','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Ross', 'Lara', '1971-11-09'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742187', '1-5479127', '9812346347', 'ross_lara@gmail.com', 'www.ross.com', '5413218', '12458518','4579097','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Aryan', 'Shannon', '1971-11-10'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742188', '1-5479128', '9812346348', 'aryan_shannon@gmail.com', 'www.aryan.com', '5413219', '12458519','4579098','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Boston', 'Sexton', '1971-11-11'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742189', '1-5479129', '9812346349', 'boston_sexton@gmail.com', 'www.boston.com', '5413220', '12458520','4579099','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Garret', 'Pace', '1971-11-12'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742190', '1-5479130', '9812346350', 'garret_pace@gmail.com', 'www.garret.com', '5413221', '12458521','4579100','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Lamar', 'Hull', '1971-11-13'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742191', '1-5479131', '9812346351', 'lamar_hull@gmail.com', 'www.lamar.com', '5413222', '12458522','4579101','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Matteo', 'Leblanc', '1971-11-14'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742192', '1-5479132', '9812346352', 'matteo_leblanc@gmail.com', 'www.matteo.com', '5413223', '12458523','4579102','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Reagan', 'Browning', '1971-11-15'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742193', '1-5479133', '9812346353', 'reagan_browning@gmail.com', 'www.reagan.com', '5413224', '12458524','4579103','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Dominique', 'Velasquez', '1971-11-16'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742194', '1-5479134', '9812346354', 'dominique_velasquez@gmail.com', 'www.dominique.com', '5413225', '12458525','4579104','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Mike', 'Leach', '1971-11-17'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742195', '1-5479135', '9812346355', 'mike_leach@gmail.com', 'www.mike.com', '5413226', '12458526','4579105','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Rhett', 'Chang', '1971-11-18'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742196', '1-5479136', '9812346356', 'rhett_chang@gmail.com', 'www.rhett.com', '5413227', '12458527','4579106','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'London', 'House', '1971-11-19'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742197', '1-5479137', '9812346357', 'london_house@gmail.com', 'www.london.com', '5413228', '12458528','4579107','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Muhammad', 'Sellers', '1971-11-20'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742198', '1-5479138', '9812346358', 'muhammad_sellers@gmail.com', 'www.muhammad.com', '5413229', '12458529','4579108','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Gideon', 'Herring', '1971-11-21'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742199', '1-5479139', '9812346359', 'gideon_herring@gmail.com', 'www.gideon.com', '5413230', '12458530','4579109','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Humberto', 'Noble', '1971-11-22'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742200', '1-5479140', '9812346360', 'humberto_noble@gmail.com', 'www.humberto.com', '5413231', '12458531','4579110','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Lawson', 'Foley', '1971-11-23'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742201', '1-5479141', '9812346361', 'lawson_foley@gmail.com', 'www.lawson.com', '5413232', '12458532','4579111','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Adrien', 'Bartlett', '1971-11-24'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742202', '1-5479142', '9812346362', 'adrien_bartlett@gmail.com', 'www.adrien.com', '5413233', '12458533','4579112','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Clarence', 'Mercado', '1971-11-25'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742203', '1-5479143', '9812346363', 'clarence_mercado@gmail.com', 'www.clarence.com', '5413234', '12458534','4579113','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Jadyn', 'Landry', '1971-11-26'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742204', '1-5479144', '9812346364', 'jadyn_landry@gmail.com', 'www.jadyn.com', '5413235', '12458535','4579114','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Javion', 'Durham', '1971-11-27'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742205', '1-5479145', '9812346365', 'javion_durham@gmail.com', 'www.javion.com', '5413236', '12458536','4579115','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Derick', 'Walls', '1971-11-28'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742206', '1-5479146', '9812346366', 'derick_walls@gmail.com', 'www.derick.com', '5413237', '12458537','4579116','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Kyan', 'Barr', '1971-11-29'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742207', '1-5479147', '9812346367', 'kyan_barr@gmail.com', 'www.kyan.com', '5413238', '12458538','4579117','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Salvatore', 'Mckee', '1971-11-30'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742208', '1-5479148', '9812346368', 'salvatore_mckee@gmail.com', 'www.salvatore.com', '5413239', '12458539','4579118','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Kareem', 'Bauer', '1971-12-01'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742209', '1-5479149', '9812346369', 'kareem_bauer@gmail.com', 'www.kareem.com', '5413240', '12458540','4579119','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Arjun', 'Rivers', '1971-12-02'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742210', '1-5479150', '9812346370', 'arjun_rivers@gmail.com', 'www.arjun.com', '5413241', '12458541','4579120','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Tyrese', 'Everett', '1971-12-03'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742211', '1-5479151', '9812346371', 'tyrese_everett@gmail.com', 'www.tyrese.com', '5413242', '12458542','4579121','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Markus', 'Bradshaw', '1971-12-04'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742212', '1-5479152', '9812346372', 'markus_bradshaw@gmail.com', 'www.markus.com', '5413243', '12458543','4579122','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Semaj', 'Pugh', '1971-12-05'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742213', '1-5479153', '9812346373', 'semaj_pugh@gmail.com', 'www.semaj.com', '5413244', '12458544','4579123','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Barrett', 'Velez', '1971-12-06'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742214', '1-5479154', '9812346374', 'barrett_velez@gmail.com', 'www.barrett.com', '5413245', '12458545','4579124','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Gavyn', 'Rush', '1971-12-07'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742215', '1-5479155', '9812346375', 'gavyn_rush@gmail.com', 'www.gavyn.com', '5413246', '12458546','4579125','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Kian', 'Estes', '1971-12-08'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742216', '1-5479156', '9812346376', 'kian_estes@gmail.com', 'www.kian.com', '5413247', '12458547','4579126','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Ryland', 'Dodson', '1971-12-09'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742217', '1-5479157', '9812346377', 'ryland_dodson@gmail.com', 'www.ryland.com', '5413248', '12458548','4579127','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Jamar', 'Morse', '1971-12-10'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742218', '1-5479158', '9812346378', 'jamar_morse@gmail.com', 'www.jamar.com', '5413249', '12458549','4579128','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Nathanial', 'Sheppard', '1971-12-11'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742219', '1-5479159', '9812346379', 'nathanial_sheppard@gmail.com', 'www.nathanial.com', '5413250', '12458550','4579129','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Moshe', 'Weeks', '1971-12-12'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742220', '1-5479160', '9812346380', 'moshe_weeks@gmail.com', 'www.moshe.com', '5413251', '12458551','4579130','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Landyn', 'Camacho', '1971-12-13'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742221', '1-5479161', '9812346381', 'landyn_camacho@gmail.com', 'www.landyn.com', '5413252', '12458552','4579131','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Ryker', 'Bean', '1971-12-14'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742222', '1-5479162', '9812346382', 'ryker_bean@gmail.com', 'www.ryker.com', '5413253', '12458553','4579132','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Alfred', 'Barron', '1971-12-15'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742223', '1-5479163', '9812346383', 'alfred_barron@gmail.com', 'www.alfred.com', '5413254', '12458554','4579133','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Giancarlo', 'Livingston', '1971-12-16'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742224', '1-5479164', '9812346384', 'giancarlo_livingston@gmail.com', 'www.giancarlo.com', '5413255', '12458555','4579134','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Kane', 'Middleton', '1971-12-17'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742225', '1-5479165', '9812346385', 'kane_middleton@gmail.com', 'www.kane.com', '5413256', '12458556','4579135','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Malakai', 'Spears', '1971-12-18'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742226', '1-5479166', '9812346386', 'malakai_spears@gmail.com', 'www.malakai.com', '5413257', '12458557','4579136','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Rory', 'Branch', '1971-12-19'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742227', '1-5479167', '9812346387', 'rory_branch@gmail.com', 'www.rory.com', '5413258', '12458558','4579137','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Darnell', 'Blevins', '1971-12-20'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742228', '1-5479168', '9812346388', 'darnell_blevins@gmail.com', 'www.darnell.com', '5413259', '12458559','4579138','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Hamza', 'Chen', '1971-12-21'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742229', '1-5479169', '9812346389', 'hamza_chen@gmail.com', 'www.hamza.com', '5413260', '12458560','4579139','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Jaron', 'Kerr', '1971-12-22'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742230', '1-5479170', '9812346390', 'jaron_kerr@gmail.com', 'www.jaron.com', '5413261', '12458561','4579140','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Ari', 'Mcconnell', '1971-12-23'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742231', '1-5479171', '9812346391', 'ari_mcconnell@gmail.com', 'www.ari.com', '5413262', '12458562','4579141','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Frankie', 'Hatfield', '1971-12-24'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742232', '1-5479172', '9812346392', 'frankie_hatfield@gmail.com', 'www.frankie.com', '5413263', '12458563','4579142','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Aditya', 'Harding', '1971-12-25'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742233', '1-5479173', '9812346393', 'aditya_harding@gmail.com', 'www.aditya.com', '5413264', '12458564','4579143','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Clinton', 'Ashley', '1971-12-26'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742234', '1-5479174', '9812346394', 'clinton_ashley@gmail.com', 'www.clinton.com', '5413265', '12458565','4579144','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Cullen', 'Solis', '1971-12-27'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742235', '1-5479175', '9812346395', 'cullen_solis@gmail.com', 'www.cullen.com', '5413266', '12458566','4579145','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Keshawn', 'Herman', '1971-12-28'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742236', '1-5479176', '9812346396', 'keshawn_herman@gmail.com', 'www.keshawn.com', '5413267', '12458567','4579146','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Milo', 'Frost', '1971-12-29'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742237', '1-5479177', '9812346397', 'milo_frost@gmail.com', 'www.milo.com', '5413268', '12458568','4579147','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Devyn', 'Giles', '1971-12-30'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742238', '1-5479178', '9812346398', 'devyn_giles@gmail.com', 'www.devyn.com', '5413269', '12458569','4579148','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Armani', 'Blackburn', '1971-12-31'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742239', '1-5479179', '9812346399', 'armani_blackburn@gmail.com', 'www.armani.com', '5413270', '12458570','4579149','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Isai', 'William', '1972-01-01'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742240', '1-5479180', '9812346400', 'isai_william@gmail.com', 'www.isai.com', '5413271', '12458571','4579150','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Jaylan', 'Pennington', '1972-01-02'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742241', '1-5479181', '9812346401', 'jaylan_pennington@gmail.com', 'www.jaylan.com', '5413272', '12458572','4579151','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Kamari', 'Woodward', '1972-01-03'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742242', '1-5479182', '9812346402', 'kamari_woodward@gmail.com', 'www.kamari.com', '5413273', '12458573','4579152','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Nigel', 'Finley', '1972-01-04'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742243', '1-5479183', '9812346403', 'nigel_finley@gmail.com', 'www.nigel.com', '5413274', '12458574','4579153','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Jovani', 'Mcintosh', '1972-01-05'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742244', '1-5479184', '9812346404', 'jovani_mcintosh@gmail.com', 'www.jovani.com', '5413275', '12458575','4579154','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Sterling', 'Koch', '1972-01-06'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742245', '1-5479185', '9812346405', 'sterling_koch@gmail.com', 'www.sterling.com', '5413276', '12458576','4579155','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Justus', 'Best', '1972-01-07'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742246', '1-5479186', '9812346406', 'justus_best@gmail.com', 'www.justus.com', '5413277', '12458577','4579156','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Dillan', 'Solomon', '1972-01-08'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742247', '1-5479187', '9812346407', 'dillan_solomon@gmail.com', 'www.dillan.com', '5413278', '12458578','4579157','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Keon', 'Mccullough', '1972-01-09'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742248', '1-5479188', '9812346408', 'keon_mccullough@gmail.com', 'www.keon.com', '5413279', '12458579','4579158','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Marques', 'Dudley', '1972-01-10'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742249', '1-5479189', '9812346409', 'marques_dudley@gmail.com', 'www.marques.com', '5413280', '12458580','4579159','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Nico', 'Nolan', '1972-01-11'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742250', '1-5479190', '9812346410', 'nico_nolan@gmail.com', 'www.nico.com', '5413281', '12458581','4579160','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Roland', 'Blanchard', '1972-01-12'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742251', '1-5479191', '9812346411', 'roland_blanchard@gmail.com', 'www.roland.com', '5413282', '12458582','4579161','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Donavan', 'Rivas', '1972-01-13'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742252', '1-5479192', '9812346412', 'donavan_rivas@gmail.com', 'www.donavan.com', '5413283', '12458583','4579162','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Giovanny', 'Brennan', '1972-01-14'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742253', '1-5479193', '9812346413', 'giovanny_brennan@gmail.com', 'www.giovanny.com', '5413284', '12458584','4579163','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Jorden', 'Mejia', '1972-01-15'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742254', '1-5479194', '9812346414', 'jorden_mejia@gmail.com', 'www.jorden.com', '5413285', '12458585','4579164','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Rigoberto', 'Kane', '1972-01-16'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742255', '1-5479195', '9812346415', 'rigoberto_kane@gmail.com', 'www.rigoberto.com', '5413286', '12458586','4579165','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Anton', 'Benton', '1972-01-17'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742256', '1-5479196', '9812346416', 'anton_benton@gmail.com', 'www.anton.com', '5413287', '12458587','4579166','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Johnpaul', 'Joyce', '1972-01-18'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742257', '1-5479197', '9812346417', 'johnpaul_joyce@gmail.com', 'www.johnpaul.com', '5413288', '12458588','4579167','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Konner', 'Buckley', '1972-01-19'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742258', '1-5479198', '9812346418', 'konner_buckley@gmail.com', 'www.konner.com', '5413289', '12458589','4579168','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Jaeden', 'Haley', '1972-01-20'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742259', '1-5479199', '9812346419', 'jaeden_haley@gmail.com', 'www.jaeden.com', '5413290', '12458590','4579169','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Enzo', 'Valentine', '1972-01-21'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742260', '1-5479200', '9812346420', 'enzo_valentine@gmail.com', 'www.enzo.com', '5413291', '12458591','4579170','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Josh', 'Maddox', '1972-01-22'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742261', '1-5479201', '9812346421', 'josh_maddox@gmail.com', 'www.josh.com', '5413292', '12458592','4579171','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Demarcus', 'Russo', '1972-01-23'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742262', '1-5479202', '9812346422', 'demarcus_russo@gmail.com', 'www.demarcus.com', '5413293', '12458593','4579172','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Estevan', 'Mcknight', '1972-01-24'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742263', '1-5479203', '9812346423', 'estevan_mcknight@gmail.com', 'www.estevan.com', '5413294', '12458594','4579173','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Rylee', 'Buck', '1972-01-25'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742264', '1-5479204', '9812346424', 'rylee_buck@gmail.com', 'www.rylee.com', '5413295', '12458595','4579174','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Yair', 'Moon', '1972-01-26'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742265', '1-5479205', '9812346425', 'yair_moon@gmail.com', 'www.yair.com', '5413296', '12458596','4579175','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Cale', 'Mcmillan', '1972-01-27'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742266', '1-5479206', '9812346426', 'cale_mcmillan@gmail.com', 'www.cale.com', '5413297', '12458597','4579176','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Kale', 'Crosby', '1972-01-28'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742267', '1-5479207', '9812346427', 'kale_crosby@gmail.com', 'www.kale.com', '5413298', '12458598','4579177','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Braedon', 'Dotson', '1972-01-30'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742269', '1-5479209', '9812346429', 'braedon_dotson@gmail.com', 'www.braedon.com', '5413300', '12458600','4579179','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Santos', 'Mays', '1972-01-31'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742270', '1-5479210', '9812346430', 'santos_mays@gmail.com', 'www.santos.com', '5413301', '12458601','4579180','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Ralph', 'Roach', '1972-02-01'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742271', '1-5479211', '9812346431', 'ralph_roach@gmail.com', 'www.ralph.com', '5413302', '12458602','4579181','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Vance', 'Church', '1972-02-02'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742272', '1-5479212', '9812346432', 'vance_church@gmail.com', 'www.vance.com', '5413303', '12458603','4579182','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Alden', 'Chan', '1972-02-03'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742273', '1-5479213', '9812346433', 'alden_chan@gmail.com', 'www.alden.com', '5413304', '12458604','4579183','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Bo', 'Richmond', '1972-02-04'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742274', '1-5479214', '9812346434', 'bo_richmond@gmail.com', 'www.bo.com', '5413305', '12458605','4579184','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Augustus', 'Meadows', '1972-02-05'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742275', '1-5479215', '9812346435', 'augustus_meadows@gmail.com', 'www.augustus.com', '5413306', '12458606','4579185','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Cannon', 'Faulkner', '1972-02-06'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742276', '1-5479216', '9812346436', 'cannon_faulkner@gmail.com', 'www.cannon.com', '5413307', '12458607','4579186','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Darryl', 'Oneill', '1972-02-07'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742277', '1-5479217', '9812346437', 'darryl_oneill@gmail.com', 'www.darryl.com', '5413308', '12458608','4579187','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Gaven', 'Knapp', '1972-02-08'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742278', '1-5479218', '9812346438', 'gaven_knapp@gmail.com', 'www.gaven.com', '5413309', '12458609','4579188','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Sheldon', 'Kline', '1972-02-09'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742279', '1-5479219', '9812346439', 'sheldon_kline@gmail.com', 'www.sheldon.com', '5413310', '12458610','4579189','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Darien', 'Barry', '1972-02-10'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742280', '1-5479220', '9812346440', 'darien_barry@gmail.com', 'www.darien.com', '5413311', '12458611','4579190','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Coby', 'Ochoa', '1972-02-11'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742281', '1-5479221', '9812346441', 'coby_ochoa@gmail.com', 'www.coby.com', '5413312', '12458612','4579191','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Glenn', 'Jacobson', '1972-02-12'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742282', '1-5479222', '9812346442', 'glenn_jacobson@gmail.com', 'www.glenn.com', '5413313', '12458613','4579192','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Vaughn', 'Gay', '1972-02-13'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742283', '1-5479223', '9812346443', 'vaughn_gay@gmail.com', 'www.vaughn.com', '5413314', '12458614','4579193','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'German', 'Avery', '1972-02-14'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742284', '1-5479224', '9812346444', 'german_avery@gmail.com', 'www.german.com', '5413315', '12458615','4579194','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Hassan', 'Hendricks', '1972-02-15'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742285', '1-5479225', '9812346445', 'hassan_hendricks@gmail.com', 'www.hassan.com', '5413316', '12458616','4579195','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Seamus', 'Horne', '1972-02-16'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742286', '1-5479226', '9812346446', 'seamus_horne@gmail.com', 'www.seamus.com', '5413317', '12458617','4579196','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Braulio', 'Shepard', '1972-02-17'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742287', '1-5479227', '9812346447', 'braulio_shepard@gmail.com', 'www.braulio.com', '5413318', '12458618','4579197','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Layton', 'Hebert', '1972-02-18'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742288', '1-5479228', '9812346448', 'layton_hebert@gmail.com', 'www.layton.com', '5413319', '12458619','4579198','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Nathen', 'Cherry', '1972-02-19'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742289', '1-5479229', '9812346449', 'nathen_cherry@gmail.com', 'www.nathen.com', '5413320', '12458620','4579199','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Luciano', 'Cardenas', '1972-02-20'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742290', '1-5479230', '9812346450', 'luciano_cardenas@gmail.com', 'www.luciano.com', '5413321', '12458621','4579200','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Roderick', 'Mcintyre', '1972-02-21'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742291', '1-5479231', '9812346451', 'roderick_mcintyre@gmail.com', 'www.roderick.com', '5413322', '12458622','4579201','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Antony', 'Whitney', '1972-02-22'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742292', '1-5479232', '9812346452', 'antony_whitney@gmail.com', 'www.antony.com', '5413323', '12458623','4579202','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Elvis', 'Waller', '1972-02-23'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742293', '1-5479233', '9812346453', 'elvis_waller@gmail.com', 'www.elvis.com', '5413324', '12458624','4579203','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Jovanni', 'Holman', '1972-02-24'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742294', '1-5479234', '9812346454', 'jovanni_holman@gmail.com', 'www.jovanni.com', '5413325', '12458625','4579204','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Samir', 'Donaldson', '1972-02-25'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742295', '1-5479235', '9812346455', 'samir_donaldson@gmail.com', 'www.samir.com', '5413326', '12458626','4579205','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Ellis', 'Cantu', '1972-02-26'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742296', '1-5479236', '9812346456', 'ellis_cantu@gmail.com', 'www.ellis.com', '5413327', '12458627','4579206','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Malaki', 'Terrell', '1972-02-27'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742297', '1-5479237', '9812346457', 'malaki_terrell@gmail.com', 'www.malaki.com', '5413328', '12458628','4579207','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Deangelo', 'Morin', '1972-02-28'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742298', '1-5479238', '9812346458', 'deangelo_morin@gmail.com', 'www.deangelo.com', '5413329', '12458629','4579208','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Jean', 'Gillespie', '1972-02-29'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742299', '1-5479239', '9812346459', 'jean_gillespie@gmail.com', 'www.jean.com', '5413330', '12458630','4579209','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Winston', 'Fuentes', '1972-03-01'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742300', '1-5479240', '9812346460', 'winston_fuentes@gmail.com', 'www.winston.com', '5413331', '12458631','4579210','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Stefan', 'Tillman', '1972-03-02'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742301', '1-5479241', '9812346461', 'stefan_tillman@gmail.com', 'www.stefan.com', '5413332', '12458632','4579211','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Adriel', 'Sanford', '1972-03-03'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742302', '1-5479242', '9812346462', 'adriel_sanford@gmail.com', 'www.adriel.com', '5413333', '12458633','4579212','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Atticus', 'Bentley', '1972-03-04'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742303', '1-5479243', '9812346463', 'atticus_bentley@gmail.com', 'www.atticus.com', '5413334', '12458634','4579213','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Clark', 'Peck', '1972-03-05'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742304', '1-5479244', '9812346464', 'clark_peck@gmail.com', 'www.clark.com', '5413335', '12458635','4579214','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Heath', 'Key', '1972-03-06'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742305', '1-5479245', '9812346465', 'heath_key@gmail.com', 'www.heath.com', '5413336', '12458636','4579215','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Jamir', 'Salas', '1972-03-07'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742306', '1-5479246', '9812346466', 'jamir_salas@gmail.com', 'www.jamir.com', '5413337', '12458637','4579216','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Korbin', 'Rollins', '1972-03-08'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742307', '1-5479247', '9812346467', 'korbin_rollins@gmail.com', 'www.korbin.com', '5413338', '12458638','4579217','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Bruno', 'Gamble', '1972-03-09'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742308', '1-5479248', '9812346468', 'bruno_gamble@gmail.com', 'www.bruno.com', '5413339', '12458639','4579218','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Alexandro', 'Dickson', '1972-03-10'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742309', '1-5479249', '9812346469', 'alexandro_dickson@gmail.com', 'www.alexandro.com', '5413340', '12458640','4579219','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Marquise', 'Battle', '1972-03-11'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742310', '1-5479250', '9812346470', 'marquise_battle@gmail.com', 'www.marquise.com', '5413341', '12458641','4579220','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Sonny', 'Santana', '1972-03-12'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742311', '1-5479251', '9812346471', 'sonny_santana@gmail.com', 'www.sonny.com', '5413342', '12458642','4579221','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Deacon', 'Cabrera', '1972-03-13'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742312', '1-5479252', '9812346472', 'deacon_cabrera@gmail.com', 'www.deacon.com', '5413343', '12458643','4579222','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Marcel', 'Cervantes', '1972-03-14'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742313', '1-5479253', '9812346473', 'marcel_cervantes@gmail.com', 'www.marcel.com', '5413344', '12458644','4579223','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Rex', 'Howe', '1972-03-15'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742314', '1-5479254', '9812346474', 'rex_howe@gmail.com', 'www.rex.com', '5413345', '12458645','4579224','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Santino', 'Hinton', '1972-03-16'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742315', '1-5479255', '9812346475', 'santino_hinton@gmail.com', 'www.santino.com', '5413346', '12458646','4579225','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Mathias', 'Hurley', '1972-03-17'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742316', '1-5479256', '9812346476', 'mathias_hurley@gmail.com', 'www.mathias.com', '5413347', '12458647','4579226','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Kylan', 'Spence', '1972-03-18'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742317', '1-5479257', '9812346477', 'kylan_spence@gmail.com', 'www.kylan.com', '5413348', '12458648','4579227','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Shamar', 'Zamora', '1972-03-19'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742318', '1-5479258', '9812346478', 'shamar_zamora@gmail.com', 'www.shamar.com', '5413349', '12458649','4579228','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Cason', 'Yang', '1972-03-20'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742319', '1-5479259', '9812346479', 'cason_yang@gmail.com', 'www.cason.com', '5413350', '12458650','4579229','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Jovanny', 'Mcneil', '1972-03-21'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742320', '1-5479260', '9812346480', 'jovanny_mcneil@gmail.com', 'www.jovanny.com', '5413351', '12458651','4579230','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Garrison', 'Suarez', '1972-03-22'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742321', '1-5479261', '9812346481', 'garrison_suarez@gmail.com', 'www.garrison.com', '5413352', '12458652','4579231','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Nick', 'Case', '1972-03-23'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742322', '1-5479262', '9812346482', 'nick_case@gmail.com', 'www.nick.com', '5413353', '12458653','4579232','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Reynaldo', 'Petty', '1972-03-24'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742323', '1-5479263', '9812346483', 'reynaldo_petty@gmail.com', 'www.reynaldo.com', '5413354', '12458654','4579233','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Milton', 'Gould', '1972-03-25'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742324', '1-5479264', '9812346484', 'milton_gould@gmail.com', 'www.milton.com', '5413355', '12458655','4579234','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Brad', 'Mcfarland', '1972-03-26'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742325', '1-5479265', '9812346485', 'brad_mcfarland@gmail.com', 'www.brad.com', '5413356', '12458656','4579235','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Adonis', 'Sampson', '1972-03-27'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742326', '1-5479266', '9812346486', 'adonis_sampson@gmail.com', 'www.adonis.com', '5413357', '12458657','4579236','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Makai', 'Carver', '1972-03-28'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742327', '1-5479267', '9812346487', 'makai_carver@gmail.com', 'www.makai.com', '5413358', '12458658','4579237','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Prince', 'Bray', '1972-03-29'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742328', '1-5479268', '9812346488', 'prince_bray@gmail.com', 'www.prince.com', '5413359', '12458659','4579238','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Howard', 'Rosario', '1972-03-30'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742329', '1-5479269', '9812346489', 'howard_rosario@gmail.com', 'www.howard.com', '5413360', '12458660','4579239','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Jovany', 'Macdonald', '1972-03-31'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742330', '1-5479270', '9812346490', 'jovany_macdonald@gmail.com', 'www.jovany.com', '5413361', '12458661','4579240','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Konnor', 'Stout', '1972-04-01'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742331', '1-5479271', '9812346491', 'konnor_stout@gmail.com', 'www.konnor.com', '5413362', '12458662','4579241','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Quinten', 'Hester', '1972-04-02'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742332', '1-5479272', '9812346492', 'quinten_hester@gmail.com', 'www.quinten.com', '5413363', '12458663','4579242','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Remington', 'Melendez', '1972-04-03'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742333', '1-5479273', '9812346493', 'remington_melendez@gmail.com', 'www.remington.com', '5413364', '12458664','4579243','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Nestor', 'Dillon', '1972-04-04'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742334', '1-5479274', '9812346494', 'nestor_dillon@gmail.com', 'www.nestor.com', '5413365', '12458665','4579244','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Cortez', 'Farley', '1972-04-05'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742335', '1-5479275', '9812346495', 'cortez_farley@gmail.com', 'www.cortez.com', '5413366', '12458666','4579245','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Kaeden', 'Hopper', '1972-04-06'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742336', '1-5479276', '9812346496', 'kaeden_hopper@gmail.com', 'www.kaeden.com', '5413367', '12458667','4579246','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Braylen', 'Galloway', '1972-04-07'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742337', '1-5479277', '9812346497', 'braylen_galloway@gmail.com', 'www.braylen.com', '5413368', '12458668','4579247','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Carlo', 'Potts', '1972-04-08'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742338', '1-5479278', '9812346498', 'carlo_potts@gmail.com', 'www.carlo.com', '5413369', '12458669','4579248','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Bernard', 'Bernard', '1972-04-09'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742339', '1-5479279', '9812346499', 'bernard_bernard@gmail.com', 'www.bernard.com', '5413370', '12458670','4579249','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Deon', 'Joyner', '1972-04-10'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742340', '1-5479280', '9812346500', 'deon_joyner@gmail.com', 'www.deon.com', '5413371', '12458671','4579250','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Sidney', 'Stein', '1972-04-11'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742341', '1-5479281', '9812346501', 'sidney_stein@gmail.com', 'www.sidney.com', '5413372', '12458672','4579251','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Jordy', 'Aguirre', '1972-04-12'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742342', '1-5479282', '9812346502', 'jordy_aguirre@gmail.com', 'www.jordy.com', '5413373', '12458673','4579252','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Conrad', 'Osborn', '1972-04-13'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742343', '1-5479283', '9812346503', 'conrad_osborn@gmail.com', 'www.conrad.com', '5413374', '12458674','4579253','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Pranav', 'Mercer', '1972-04-14'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742344', '1-5479284', '9812346504', 'pranav_mercer@gmail.com', 'www.pranav.com', '5413375', '12458675','4579254','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Dangelo', 'Bender', '1972-04-15'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742345', '1-5479285', '9812346505', 'dangelo_bender@gmail.com', 'www.dangelo.com', '5413376', '12458676','4579255','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Ean', 'Franco', '1972-04-16'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742346', '1-5479286', '9812346506', 'ean_franco@gmail.com', 'www.ean.com', '5413377', '12458677','4579256','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Houston', 'Rowland', '1972-04-17'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742347', '1-5479287', '9812346507', 'houston_rowland@gmail.com', 'www.houston.com', '5413378', '12458678','4579257','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Savion', 'Sykes', '1972-04-18'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742348', '1-5479288', '9812346508', 'savion_sykes@gmail.com', 'www.savion.com', '5413379', '12458679','4579258','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Cael', 'Benjamin', '1972-04-19'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742349', '1-5479289', '9812346509', 'cael_benjamin@gmail.com', 'www.cael.com', '5413380', '12458680','4579259','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Elmer', 'Travis', '1972-04-20'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742350', '1-5479290', '9812346510', 'elmer_travis@gmail.com', 'www.elmer.com', '5413381', '12458681','4579260','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Josef', 'Pickett', '1972-04-21'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742351', '1-5479291', '9812346511', 'josef_pickett@gmail.com', 'www.josef.com', '5413382', '12458682','4579261','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Antwan', 'Crane', '1972-04-22'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742352', '1-5479292', '9812346512', 'antwan_crane@gmail.com', 'www.antwan.com', '5413383', '12458683','4579262','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Aydin', 'Sears', '1972-04-23'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742353', '1-5479293', '9812346513', 'aydin_sears@gmail.com', 'www.aydin.com', '5413384', '12458684','4579263','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Dario', 'Mayo', '1972-04-24'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742354', '1-5479294', '9812346514', 'dario_mayo@gmail.com', 'www.dario.com', '5413385', '12458685','4579264','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Devonte', 'Dunlap', '1972-04-25'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742355', '1-5479295', '9812346515', 'devonte_dunlap@gmail.com', 'www.devonte.com', '5413386', '12458686','4579265','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Marcelo', 'Hayden', '1972-04-26'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742356', '1-5479296', '9812346516', 'marcelo_hayden@gmail.com', 'www.marcelo.com', '5413387', '12458687','4579266','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Kamden', 'Wilder', '1972-04-27'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742357', '1-5479297', '9812346517', 'kamden_wilder@gmail.com', 'www.kamden.com', '5413388', '12458688','4579267','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Keyon', 'Mckay', '1972-04-28'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742358', '1-5479298', '9812346518', 'keyon_mckay@gmail.com', 'www.keyon.com', '5413389', '12458689','4579268','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Lucian', 'Coffey', '1972-04-29'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742359', '1-5479299', '9812346519', 'lucian_coffey@gmail.com', 'www.lucian.com', '5413390', '12458690','4579269','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Gonzalo', 'Mccarty', '1972-04-30'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742360', '1-5479300', '9812346520', 'gonzalo_mccarty@gmail.com', 'www.gonzalo.com', '5413391', '12458691','4579270','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Jan', 'Ewing', '1972-05-01'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742361', '1-5479301', '9812346521', 'jan_ewing@gmail.com', 'www.jan.com', '5413392', '12458692','4579271','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Kadyn', 'Cooley', '1972-05-02'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742362', '1-5479302', '9812346522', 'kadyn_cooley@gmail.com', 'www.kadyn.com', '5413393', '12458693','4579272','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Rashad', 'Vaughan', '1972-05-03'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742363', '1-5479303', '9812346523', 'rashad_vaughan@gmail.com', 'www.rashad.com', '5413394', '12458694','4579273','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Zain', 'Bonner', '1972-05-04'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742364', '1-5479304', '9812346524', 'zain_bonner@gmail.com', 'www.zain.com', '5413395', '12458695','4579274','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Tristian', 'Cotton', '1972-05-05'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742365', '1-5479305', '9812346525', 'tristian_cotton@gmail.com', 'www.tristian.com', '5413396', '12458696','4579275','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Blaze', 'Holder', '1972-05-06'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742366', '1-5479306', '9812346526', 'blaze_holder@gmail.com', 'www.blaze.com', '5413397', '12458697','4579276','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Darwin', 'Stark', '1972-05-07'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742367', '1-5479307', '9812346527', 'darwin_stark@gmail.com', 'www.darwin.com', '5413398', '12458698','4579277','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Elian', 'Ferrell', '1972-05-08'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742368', '1-5479308', '9812346528', 'elian_ferrell@gmail.com', 'www.elian.com', '5413399', '12458699','4579278','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Giovani', 'Cantrell', '1972-05-09'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742369', '1-5479309', '9812346529', 'giovani_cantrell@gmail.com', 'www.giovani.com', '5413400', '12458700','4579279','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Haden', 'Fulton', '1972-05-10'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742370', '1-5479310', '9812346530', 'haden_fulton@gmail.com', 'www.haden.com', '5413401', '12458701','4579280','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Sammy', 'Lynn', '1972-05-11'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742371', '1-5479311', '9812346531', 'sammy_lynn@gmail.com', 'www.sammy.com', '5413402', '12458702','4579281','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Yosef', 'Lott', '1972-05-12'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742372', '1-5479312', '9812346532', 'yosef_lott@gmail.com', 'www.yosef.com', '5413403', '12458703','4579282','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Domenic', 'Calderon', '1972-05-13'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742373', '1-5479313', '9812346533', 'domenic_calderon@gmail.com', 'www.domenic.com', '5413404', '12458704','4579283','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Jovan', 'Rosa', '1972-05-14'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742374', '1-5479314', '9812346534', 'jovan_rosa@gmail.com', 'www.jovan.com', '5413405', '12458705','4579284','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Matias', 'Pollard', '1972-05-15'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742375', '1-5479315', '9812346535', 'matias_pollard@gmail.com', 'www.matias.com', '5413406', '12458706','4579285','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Simeon', 'Hooper', '1972-05-16'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742376', '1-5479316', '9812346536', 'simeon_hooper@gmail.com', 'www.simeon.com', '5413407', '12458707','4579286','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Nikhil', 'Burch', '1972-05-17'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742377', '1-5479317', '9812346537', 'nikhil_burch@gmail.com', 'www.nikhil.com', '5413408', '12458708','4579287','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Teagan', 'Mullen', '1972-05-18'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742378', '1-5479318', '9812346538', 'teagan_mullen@gmail.com', 'www.teagan.com', '5413409', '12458709','4579288','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Luka', 'Fry', '1972-05-19'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742379', '1-5479319', '9812346539', 'luka_fry@gmail.com', 'www.luka.com', '5413410', '12458710','4579289','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Zaire', 'Riddle', '1972-05-20'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742380', '1-5479320', '9812346540', 'zaire_riddle@gmail.com', 'www.zaire.com', '5413411', '12458711','4579290','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Bronson', 'Levy', '1972-05-21'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742381', '1-5479321', '9812346541', 'bronson_levy@gmail.com', 'www.bronson.com', '5413412', '12458712','4579291','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Carmine', 'David', '1972-05-22'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742382', '1-5479322', '9812346542', 'carmine_david@gmail.com', 'www.carmine.com', '5413413', '12458713','4579292','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Chaim', 'Duke', '1972-05-23'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742383', '1-5479323', '9812346543', 'chaim_duke@gmail.com', 'www.chaim.com', '5413414', '12458714','4579293','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Dexter', 'Odonnell', '1972-05-24'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742384', '1-5479324', '9812346544', 'dexter_odonnell@gmail.com', 'www.dexter.com', '5413415', '12458715','4579294','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Jamel', 'Guy', '1972-05-25'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742385', '1-5479325', '9812346545', 'jamel_guy@gmail.com', 'www.jamel.com', '5413416', '12458716','4579295','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Paxton', 'Michael', '1972-05-26'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742386', '1-5479326', '9812346546', 'paxton_michael@gmail.com', 'www.paxton.com', '5413417', '12458717','4579296','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Franco', 'Britt', '1972-05-27'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742387', '1-5479327', '9812346547', 'franco_britt@gmail.com', 'www.franco.com', '5413418', '12458718','4579297','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Gordon', 'Frederick', '1972-05-28'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742388', '1-5479328', '9812346548', 'gordon_frederick@gmail.com', 'www.gordon.com', '5413419', '12458719','4579298','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Leandro', 'Daugherty', '1972-05-29'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742389', '1-5479329', '9812346549', 'leandro_daugherty@gmail.com', 'www.leandro.com', '5413420', '12458720','4579299','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Maximillian', 'Berger', '1972-05-30'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742390', '1-5479330', '9812346550', 'maximillian_berger@gmail.com', 'www.maximillian.com', '5413421', '12458721','4579300','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Korey', 'Dillard', '1972-05-31'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742391', '1-5479331', '9812346551', 'korey_dillard@gmail.com', 'www.korey.com', '5413422', '12458722','4579301','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Abdullah', 'Alston', '1972-06-01'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742392', '1-5479332', '9812346552', 'abdullah_alston@gmail.com', 'www.abdullah.com', '5413423', '12458723','4579302','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Aedan', 'Jarvis', '1972-06-02'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742393', '1-5479333', '9812346553', 'aedan_jarvis@gmail.com', 'www.aedan.com', '5413424', '12458724','4579303','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Kason', 'Frye', '1972-06-03'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742394', '1-5479334', '9812346554', 'kason_frye@gmail.com', 'www.kason.com', '5413425', '12458725','4579304','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Andreas', 'Riggs', '1972-06-04'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742395', '1-5479335', '9812346555', 'andreas_riggs@gmail.com', 'www.andreas.com', '5413426', '12458726','4579305','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Finnegan', 'Chaney', '1972-06-05'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742396', '1-5479336', '9812346556', 'finnegan_chaney@gmail.com', 'www.finnegan.com', '5413427', '12458727','4579306','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Zakary', 'Odom', '1972-06-06'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742397', '1-5479337', '9812346557', 'zakary_odom@gmail.com', 'www.zakary.com', '5413428', '12458728','4579307','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Kanye', 'Duffy', '1972-06-07'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742398', '1-5479338', '9812346558', 'kanye_duffy@gmail.com', 'www.kanye.com', '5413429', '12458729','4579308','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Matthias', 'Fitzpatrick', '1972-06-08'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742399', '1-5479339', '9812346559', 'matthias_fitzpatrick@gmail.com', 'www.matthias.com', '5413430', '12458730','4579309','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Denzel', 'Valenzuela', '1972-06-09'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742400', '1-5479340', '9812346560', 'denzel_valenzuela@gmail.com', 'www.denzel.com', '5413431', '12458731','4579310','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Reuben', 'Merrill', '1972-06-10'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742401', '1-5479341', '9812346561', 'reuben_merrill@gmail.com', 'www.reuben.com', '5413432', '12458732','4579311','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Soren', 'Mayer', '1972-06-11'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742402', '1-5479342', '9812346562', 'soren_mayer@gmail.com', 'www.soren.com', '5413433', '12458733','4579312','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Travon', 'Alford', '1972-06-12'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742403', '1-5479343', '9812346563', 'travon_alford@gmail.com', 'www.travon.com', '5413434', '12458734','4579313','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Vincenzo', 'Mcpherson', '1972-06-13'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742404', '1-5479344', '9812346564', 'vincenzo_mcpherson@gmail.com', 'www.vincenzo.com', '5413435', '12458735','4579314','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Carmelo', 'Acevedo', '1972-06-14'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742405', '1-5479345', '9812346565', 'carmelo_acevedo@gmail.com', 'www.carmelo.com', '5413436', '12458736','4579315','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Jacoby', 'Donovan', '1972-06-15'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742406', '1-5479346', '9812346566', 'jacoby_donovan@gmail.com', 'www.jacoby.com', '5413437', '12458737','4579316','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Karter', 'Barrera', '1972-06-16'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742407', '1-5479347', '9812346567', 'karter_barrera@gmail.com', 'www.karter.com', '5413438', '12458738','4579317','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Ronaldo', 'Albert', '1972-06-17'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742408', '1-5479348', '9812346568', 'ronaldo_albert@gmail.com', 'www.ronaldo.com', '5413439', '12458739','4579318','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Chaz', 'Cote', '1972-06-18'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742409', '1-5479349', '9812346569', 'chaz_cote@gmail.com', 'www.chaz.com', '5413440', '12458740','4579319','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Damari', 'Reilly', '1972-06-19'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742410', '1-5479350', '9812346570', 'damari_reilly@gmail.com', 'www.damari.com', '5413441', '12458741','4579320','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Rey', 'Compton', '1972-06-20'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742411', '1-5479351', '9812346571', 'rey_compton@gmail.com', 'www.rey.com', '5413442', '12458742','4579321','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Messiah', 'Raymond', '1972-06-21'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742412', '1-5479352', '9812346572', 'messiah_raymond@gmail.com', 'www.messiah.com', '5413443', '12458743','4579322','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Zavier', 'Mooney', '1972-06-22'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742413', '1-5479353', '9812346573', 'zavier_mooney@gmail.com', 'www.zavier.com', '5413444', '12458744','4579323','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Broderick', 'Mcgowan', '1972-06-23'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742414', '1-5479354', '9812346574', 'broderick_mcgowan@gmail.com', 'www.broderick.com', '5413445', '12458745','4579324','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Darrius', 'Craft', '1972-06-24'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742415', '1-5479355', '9812346575', 'darrius_craft@gmail.com', 'www.darrius.com', '5413446', '12458746','4579325','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Gaige', 'Cleveland', '1972-06-25'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742416', '1-5479356', '9812346576', 'gaige_cleveland@gmail.com', 'www.gaige.com', '5413447', '12458747','4579326','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Maximo', 'Clemons', '1972-06-26'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742417', '1-5479357', '9812346577', 'maximo_clemons@gmail.com', 'www.maximo.com', '5413448', '12458748','4579327','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Royce', 'Wynn', '1972-06-27'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742418', '1-5479358', '9812346578', 'royce_wynn@gmail.com', 'www.royce.com', '5413449', '12458749','4579328','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Shannon', 'Nielsen', '1972-06-28'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742419', '1-5479359', '9812346579', 'shannon_nielsen@gmail.com', 'www.shannon.com', '5413450', '12458750','4579329','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Stephan', 'Baird', '1972-06-29'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742420', '1-5479360', '9812346580', 'stephan_baird@gmail.com', 'www.stephan.com', '5413451', '12458751','4579330','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Makhi', 'Stanton', '1972-06-30'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742421', '1-5479361', '9812346581', 'makhi_stanton@gmail.com', 'www.makhi.com', '5413452', '12458752','4579331','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Gannon', 'Snider', '1972-07-01'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742422', '1-5479362', '9812346582', 'gannon_snider@gmail.com', 'www.gannon.com', '5413453', '12458753','4579332','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Immanuel', 'Rosales', '1972-07-02'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742423', '1-5479363', '9812346583', 'immanuel_rosales@gmail.com', 'www.immanuel.com', '5413454', '12458754','4579333','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Tyshawn', 'Bright', '1972-07-03'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742424', '1-5479364', '9812346584', 'tyshawn_bright@gmail.com', 'www.tyshawn.com', '5413455', '12458755','4579334','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Cristofer', 'Witt', '1972-07-04'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742425', '1-5479365', '9812346585', 'cristofer_witt@gmail.com', 'www.cristofer.com', '5413456', '12458756','4579335','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Ethen', 'Stuart', '1972-07-05'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742426', '1-5479366', '9812346586', 'ethen_stuart@gmail.com', 'www.ethen.com', '5413457', '12458757','4579336','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Jeramiah', 'Hays', '1972-07-06'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742427', '1-5479367', '9812346587', 'jeramiah_hays@gmail.com', 'www.jeramiah.com', '5413458', '12458758','4579337','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Fredrick', 'Holden', '1972-07-07'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742428', '1-5479368', '9812346588', 'fredrick_holden@gmail.com', 'www.fredrick.com', '5413459', '12458759','4579338','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Sullivan', 'Rutledge', '1972-07-08'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742429', '1-5479369', '9812346589', 'sullivan_rutledge@gmail.com', 'www.sullivan.com', '5413460', '12458760','4579339','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Norman', 'Kinney', '1972-07-09'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742430', '1-5479370', '9812346590', 'norman_kinney@gmail.com', 'www.norman.com', '5413461', '12458761','4579340','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Brenton', 'Clements', '1972-07-10'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742431', '1-5479371', '9812346591', 'brenton_clements@gmail.com', 'www.brenton.com', '5413462', '12458762','4579341','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Campbell', 'Castaneda', '1972-07-11'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742432', '1-5479372', '9812346592', 'campbell_castaneda@gmail.com', 'www.campbell.com', '5413463', '12458763','4579342','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Fredy', 'Slater', '1972-07-12'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742433', '1-5479373', '9812346593', 'fredy_slater@gmail.com', 'www.fredy.com', '5413464', '12458764','4579343','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Keven', 'Hahn', '1972-07-13'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742434', '1-5479374', '9812346594', 'keven_hahn@gmail.com', 'www.keven.com', '5413465', '12458765','4579344','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Stone', 'Emerson', '1972-07-14'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742435', '1-5479375', '9812346595', 'stone_emerson@gmail.com', 'www.stone.com', '5413466', '12458766','4579345','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Clifford', 'Conrad', '1972-07-15'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742436', '1-5479376', '9812346596', 'clifford_conrad@gmail.com', 'www.clifford.com', '5413467', '12458767','4579346','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Deshaun', 'Burks', '1972-07-16'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742437', '1-5479377', '9812346597', 'deshaun_burks@gmail.com', 'www.deshaun.com', '5413468', '12458768','4579347','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Jordyn', 'Delaney', '1972-07-17'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742438', '1-5479378', '9812346598', 'jordyn_delaney@gmail.com', 'www.jordyn.com', '5413469', '12458769','4579348','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Kamren', 'Pate', '1972-07-18'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742439', '1-5479379', '9812346599', 'kamren_pate@gmail.com', 'www.kamren.com', '5413470', '12458770','4579349','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Nash', 'Lancaster', '1972-07-19'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742440', '1-5479380', '9812346600', 'nash_lancaster@gmail.com', 'www.nash.com', '5413471', '12458771','4579350','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Rishi', 'Sweet', '1972-07-20'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742441', '1-5479381', '9812346601', 'rishi_sweet@gmail.com', 'www.rishi.com', '5413472', '12458772','4579351','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Zack', 'Justice', '1972-07-21'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742442', '1-5479382', '9812346602', 'zack_justice@gmail.com', 'www.zack.com', '5413473', '12458773','4579352','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Darin', 'Tyson', '1972-07-22'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742443', '1-5479383', '9812346603', 'darin_tyson@gmail.com', 'www.darin.com', '5413474', '12458774','4579353','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Destin', 'Sharpe', '1972-07-23'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742444', '1-5479384', '9812346604', 'destin_sharpe@gmail.com', 'www.destin.com', '5413475', '12458775','4579354','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Guadalupe', 'Whitfield', '1972-07-24'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742445', '1-5479385', '9812346605', 'guadalupe_whitfield@gmail.com', 'www.guadalupe.com', '5413476', '12458776','4579355','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Jarvis', 'Talley', '1972-07-25'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742446', '1-5479386', '9812346606', 'jarvis_talley@gmail.com', 'www.jarvis.com', '5413477', '12458777','4579356','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Perry', 'Macias', '1972-07-26'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742447', '1-5479387', '9812346607', 'perry_macias@gmail.com', 'www.perry.com', '5413478', '12458778','4579357','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Dandre', 'Irwin', '1972-07-27'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742448', '1-5479388', '9812346608', 'dandre_irwin@gmail.com', 'www.dandre.com', '5413479', '12458779','4579358','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Daryl', 'Burris', '1972-07-28'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742449', '1-5479389', '9812346609', 'daryl_burris@gmail.com', 'www.daryl.com', '5413480', '12458780','4579359','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Jaidyn', 'Ratliff', '1972-07-29'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742450', '1-5479390', '9812346610', 'jaidyn_ratliff@gmail.com', 'www.jaidyn.com', '5413481', '12458781','4579360','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Thaddeus', 'Mccray', '1972-07-30'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742451', '1-5479391', '9812346611', 'thaddeus_mccray@gmail.com', 'www.thaddeus.com', '5413482', '12458782','4579361','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Elvin', 'Madden', '1972-07-31'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742452', '1-5479392', '9812346612', 'elvin_madden@gmail.com', 'www.elvin.com', '5413483', '12458783','4579362','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Tayshaun', 'Kaufman', '1972-08-01'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742453', '1-5479393', '9812346613', 'tayshaun_kaufman@gmail.com', 'www.tayshaun.com', '5413484', '12458784','4579363','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Valentin', 'Beach', '1972-08-02'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742454', '1-5479394', '9812346614', 'valentin_beach@gmail.com', 'www.valentin.com', '5413485', '12458785','4579364','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Yusuf', 'Goff', '1972-08-03'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742455', '1-5479395', '9812346615', 'yusuf_goff@gmail.com', 'www.yusuf.com', '5413486', '12458786','4579365','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Austen', 'Cash', '1972-08-04'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742456', '1-5479396', '9812346616', 'austen_cash@gmail.com', 'www.austen.com', '5413487', '12458787','4579366','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Camryn', 'Bolton', '1972-08-05'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742457', '1-5479397', '9812346617', 'camryn_bolton@gmail.com', 'www.camryn.com', '5413488', '12458788','4579367','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Colt', 'Mcfadden', '1972-08-06'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742458', '1-5479398', '9812346618', 'colt_mcfadden@gmail.com', 'www.colt.com', '5413489', '12458789','4579368','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Darion', 'Levine', '1972-08-07'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742459', '1-5479399', '9812346619', 'darion_levine@gmail.com', 'www.darion.com', '5413490', '12458790','4579369','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Dimitri', 'Good', '1972-08-08'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742460', '1-5479400', '9812346620', 'dimitri_good@gmail.com', 'www.dimitri.com', '5413491', '12458791','4579370','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Earl', 'Byers', '1972-08-09'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742461', '1-5479401', '9812346621', 'earl_byers@gmail.com', 'www.earl.com', '5413492', '12458792','4579371','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Arnav', 'Kirkland', '1972-08-10'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742462', '1-5479402', '9812346622', 'arnav_kirkland@gmail.com', 'www.arnav.com', '5413493', '12458793','4579372','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Baby', 'Kidd', '1972-08-11'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742463', '1-5479403', '9812346623', 'baby_kidd@gmail.com', 'www.baby.com', '5413494', '12458794','4579373','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Kelton', 'Workman', '1972-08-12'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742464', '1-5479404', '9812346624', 'kelton_workman@gmail.com', 'www.kelton.com', '5413495', '12458795','4579374','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Kurt', 'Carney', '1972-08-13'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742465', '1-5479405', '9812346625', 'kurt_carney@gmail.com', 'www.kurt.com', '5413496', '12458796','4579375','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Leroy', 'Dale', '1972-08-14'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742466', '1-5479406', '9812346626', 'leroy_dale@gmail.com', 'www.leroy.com', '5413497', '12458797','4579376','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Mariano', 'Mcleod', '1972-08-15'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742467', '1-5479407', '9812346627', 'mariano_mcleod@gmail.com', 'www.mariano.com', '5413498', '12458798','4579377','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Dallin', 'Holcomb', '1972-08-16'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742468', '1-5479408', '9812346628', 'dallin_holcomb@gmail.com', 'www.dallin.com', '5413499', '12458799','4579378','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Dion', 'England', '1972-08-17'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742469', '1-5479409', '9812346629', 'dion_england@gmail.com', 'www.dion.com', '5413500', '12458800','4579379','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Reilly', 'Finch', '1972-08-18'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742470', '1-5479410', '9812346630', 'reilly_finch@gmail.com', 'www.reilly.com', '5413501', '12458801','4579380','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Efren', 'Head', '1972-08-19'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742471', '1-5479411', '9812346631', 'efren_head@gmail.com', 'www.efren.com', '5413502', '12458802','4579381','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Fidel', 'Burt', '1972-08-20'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742472', '1-5479412', '9812346632', 'fidel_burt@gmail.com', 'www.fidel.com', '5413503', '12458803','4579382','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Jaydin', 'Hendrix', '1972-08-21'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742473', '1-5479413', '9812346633', 'jaydin_hendrix@gmail.com', 'www.jaydin.com', '5413504', '12458804','4579383','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Rocky', 'Sosa', '1972-08-22'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742474', '1-5479414', '9812346634', 'rocky_sosa@gmail.com', 'www.rocky.com', '5413505', '12458805','4579384','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Shayne', 'Haney', '1972-08-23'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742475', '1-5479415', '9812346635', 'shayne_haney@gmail.com', 'www.shayne.com', '5413506', '12458806','4579385','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Bernardo', 'Franks', '1972-08-24'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742476', '1-5479416', '9812346636', 'bernardo_franks@gmail.com', 'www.bernardo.com', '5413507', '12458807','4579386','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Branson', 'Sargent', '1972-08-25'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742477', '1-5479417', '9812346637', 'branson_sargent@gmail.com', 'www.branson.com', '5413508', '12458808','4579387','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Hugh', 'Nieves', '1972-08-26'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742478', '1-5479418', '9812346638', 'hugh_nieves@gmail.com', 'www.hugh.com', '5413509', '12458809','4579388','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Maxim', 'Downs', '1972-08-27'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742479', '1-5479419', '9812346639', 'maxim_downs@gmail.com', 'www.maxim.com', '5413510', '12458810','4579389','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Shea', 'Rasmussen', '1972-08-28'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742480', '1-5479420', '9812346640', 'shea_rasmussen@gmail.com', 'www.shea.com', '5413511', '12458811','4579390','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Carlton', 'Bird', '1972-08-29'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742481', '1-5479421', '9812346641', 'carlton_bird@gmail.com', 'www.carlton.com', '5413512', '12458812','4579391','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Dylon', 'Hewitt', '1972-08-30'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742482', '1-5479422', '9812346642', 'dylon_hewitt@gmail.com', 'www.dylon.com', '5413513', '12458813','4579392','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Gauge', 'Lindsay', '1972-08-31'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742483', '1-5479423', '9812346643', 'gauge_lindsay@gmail.com', 'www.gauge.com', '5413514', '12458814','4579393','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Cristobal', 'Le', '1972-09-01'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742484', '1-5479424', '9812346644', 'cristobal_le@gmail.com', 'www.cristobal.com', '5413515', '12458815','4579394','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Irving', 'Foreman', '1972-09-02'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742485', '1-5479425', '9812346645', 'irving_foreman@gmail.com', 'www.irving.com', '5413516', '12458816','4579395','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Marquez', 'Valencia', '1972-09-03'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742486', '1-5479426', '9812346646', 'marquez_valencia@gmail.com', 'www.marquez.com', '5413517', '12458817','4579396','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Ulysses', 'Oneil', '1972-09-04'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742487', '1-5479427', '9812346647', 'ulysses_oneil@gmail.com', 'www.ulysses.com', '5413518', '12458818','4579397','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Jax', 'Delacruz', '1972-09-05'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742488', '1-5479428', '9812346648', 'jax_delacruz@gmail.com', 'www.jax.com', '5413519', '12458819','4579398','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Mikel', 'Vinson', '1972-09-06'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742489', '1-5479429', '9812346649', 'mikel_vinson@gmail.com', 'www.mikel.com', '5413520', '12458820','4579399','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Rhys', 'Dejesus', '1972-09-07'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742490', '1-5479430', '9812346650', 'rhys_dejesus@gmail.com', 'www.rhys.com', '5413521', '12458821','4579400','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Van', 'Hyde', '1972-09-08'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742491', '1-5479431', '9812346651', 'van_hyde@gmail.com', 'www.van.com', '5413522', '12458822','4579401','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Cornelius', 'Forbes', '1972-09-09'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742492', '1-5479432', '9812346652', 'cornelius_forbes@gmail.com', 'www.cornelius.com', '5413523', '12458823','4579402','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Geoffrey', 'Gilliam', '1972-09-10'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742493', '1-5479433', '9812346653', 'geoffrey_gilliam@gmail.com', 'www.geoffrey.com', '5413524', '12458824','4579403','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Eliseo', 'Guthrie', '1972-09-11'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742494', '1-5479434', '9812346654', 'eliseo_guthrie@gmail.com', 'www.eliseo.com', '5413525', '12458825','4579404','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Jaren', 'Wooten', '1972-09-12'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742495', '1-5479435', '9812346655', 'jaren_wooten@gmail.com', 'www.jaren.com', '5413526', '12458826','4579405','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Kennedy', 'Huber', '1972-09-13'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742496', '1-5479436', '9812346656', 'kennedy_huber@gmail.com', 'www.kennedy.com', '5413527', '12458827','4579406','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Markell', 'Barlow', '1972-09-14'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742497', '1-5479437', '9812346657', 'markell_barlow@gmail.com', 'www.markell.com', '5413528', '12458828','4579407','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Adin', 'Boyle', '1972-09-15'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742498', '1-5479438', '9812346658', 'adin_boyle@gmail.com', 'www.adin.com', '5413529', '12458829','4579408','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Isaak', 'Mcmahon', '1972-09-16'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742499', '1-5479439', '9812346659', 'isaak_mcmahon@gmail.com', 'www.isaak.com', '5413530', '12458830','4579409','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Keanu', 'Buckner', '1972-09-17'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742500', '1-5479440', '9812346660', 'keanu_buckner@gmail.com', 'www.keanu.com', '5413531', '12458831','4579410','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Keyshawn', 'Rocha', '1972-09-18'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742501', '1-5479441', '9812346661', 'keyshawn_rocha@gmail.com', 'www.keyshawn.com', '5413532', '12458832','4579411','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Tariq', 'Puckett', '1972-09-19'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742502', '1-5479442', '9812346662', 'tariq_puckett@gmail.com', 'www.tariq.com', '5413533', '12458833','4579412','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Daquan', 'Langley', '1972-09-20'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742503', '1-5479443', '9812346663', 'daquan_langley@gmail.com', 'www.daquan.com', '5413534', '12458834','4579413','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Edison', 'Knowles', '1972-09-21'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742504', '1-5479444', '9812346664', 'edison_knowles@gmail.com', 'www.edison.com', '5413535', '12458835','4579414','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Bridger', 'Cooke', '1972-09-22'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742505', '1-5479445', '9812346665', 'bridger_cooke@gmail.com', 'www.bridger.com', '5413536', '12458836','4579415','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Fisher', 'Velazquez', '1972-09-23'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742506', '1-5479446', '9812346666', 'fisher_velazquez@gmail.com', 'www.fisher.com', '5413537', '12458837','4579416','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Jaheim', 'Whitley', '1972-09-24'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742507', '1-5479447', '9812346667', 'jaheim_whitley@gmail.com', 'www.jaheim.com', '5413538', '12458838','4579417','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Tye', 'Noel', '1972-09-25'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742508', '1-5479448', '9812346668', 'tye_noel@gmail.com', 'www.tye.com', '5413539', '12458839','4579418','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Blaise', 'Vang', '1972-09-26'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742509', '1-5479449', '9812346669', 'blaise_vang@gmail.com', 'www.blaise.com', '5413540', '12458840','4579419','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Emily', 'Shea', '1972-09-27'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742510', '1-5479450', '9812346670', 'emily_shea@gmail.com', 'www.emily.com', '5413541', '12458841','4579420','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Emma', 'Rouse', '1972-09-28'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742511', '1-5479451', '9812346671', 'emma_rouse@gmail.com', 'www.emma.com', '5413542', '12458842','4579421','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Madison', 'Hartley', '1972-09-29'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742512', '1-5479452', '9812346672', 'madison_hartley@gmail.com', 'www.madison.com', '5413543', '12458843','4579422','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Abigail', 'Mayfield', '1972-09-30'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742513', '1-5479453', '9812346673', 'abigail_mayfield@gmail.com', 'www.abigail.com', '5413544', '12458844','4579423','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Olivia', 'Elder', '1972-10-01'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742514', '1-5479454', '9812346674', 'olivia_elder@gmail.com', 'www.olivia.com', '5413545', '12458845','4579424','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Isabella', 'Rankin', '1972-10-02'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742515', '1-5479455', '9812346675', 'isabella_rankin@gmail.com', 'www.isabella.com', '5413546', '12458846','4579425','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Hannah', 'Hanna', '1972-10-03'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742516', '1-5479456', '9812346676', 'hannah_hanna@gmail.com', 'www.hannah.com', '5413547', '12458847','4579426','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Samantha', 'Cowan', '1972-10-04'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742517', '1-5479457', '9812346677', 'samantha_cowan@gmail.com', 'www.samantha.com', '5413548', '12458848','4579427','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Ava', 'Lucero', '1972-10-05'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742518', '1-5479458', '9812346678', 'ava_lucero@gmail.com', 'www.ava.com', '5413549', '12458849','4579428','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Ashley', 'Arroyo', '1972-10-06'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742519', '1-5479459', '9812346679', 'ashley_arroyo@gmail.com', 'www.ashley.com', '5413550', '12458850','4579429','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Sophia', 'Slaughter', '1972-10-07'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742520', '1-5479460', '9812346680', 'sophia_slaughter@gmail.com', 'www.sophia.com', '5413551', '12458851','4579430','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Elizabeth', 'Haas', '1972-10-08'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742521', '1-5479461', '9812346681', 'elizabeth_haas@gmail.com', 'www.elizabeth.com', '5413552', '12458852','4579431','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Alexis', 'Oconnell', '1972-10-09'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742522', '1-5479462', '9812346682', 'alexis_oconnell@gmail.com', 'www.alexis.com', '5413553', '12458853','4579432','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Grace', 'Minor', '1972-10-10'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742523', '1-5479463', '9812346683', 'grace_minor@gmail.com', 'www.grace.com', '5413554', '12458854','4579433','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Sarah', 'Kendrick', '1972-10-11'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742524', '1-5479464', '9812346684', 'sarah_kendrick@gmail.com', 'www.sarah.com', '5413555', '12458855','4579434','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Alyssa', 'Shirley', '1972-10-12'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742525', '1-5479465', '9812346685', 'alyssa_shirley@gmail.com', 'www.alyssa.com', '5413556', '12458856','4579435','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Mia', 'Kendall', '1972-10-13'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742526', '1-5479466', '9812346686', 'mia_kendall@gmail.com', 'www.mia.com', '5413557', '12458857','4579436','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Natalie', 'Boucher', '1972-10-14'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742527', '1-5479467', '9812346687', 'natalie_boucher@gmail.com', 'www.natalie.com', '5413558', '12458858','4579437','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Chloe', 'Archer', '1972-10-15'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742528', '1-5479468', '9812346688', 'chloe_archer@gmail.com', 'www.chloe.com', '5413559', '12458859','4579438','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Brianna', 'Boggs', '1972-10-16'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742529', '1-5479469', '9812346689', 'brianna_boggs@gmail.com', 'www.brianna.com', '5413560', '12458860','4579439','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Lauren', 'Odell', '1972-10-17'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742530', '1-5479470', '9812346690', 'lauren_odell@gmail.com', 'www.lauren.com', '5413561', '12458861','4579440','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Ella', 'Dougherty', '1972-10-18'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742531', '1-5479471', '9812346691', 'ella_dougherty@gmail.com', 'www.ella.com', '5413562', '12458862','4579441','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Anna', 'Andersen', '1972-10-19'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742532', '1-5479472', '9812346692', 'anna_andersen@gmail.com', 'www.anna.com', '5413563', '12458863','4579442','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Taylor', 'Newell', '1972-10-20'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742533', '1-5479473', '9812346693', 'taylor_newell@gmail.com', 'www.taylor.com', '5413564', '12458864','4579443','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Kayla', 'Crowe', '1972-10-21'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742534', '1-5479474', '9812346694', 'kayla_crowe@gmail.com', 'www.kayla.com', '5413565', '12458865','4579444','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Hailey', 'Wang', '1972-10-22'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742535', '1-5479475', '9812346695', 'hailey_wang@gmail.com', 'www.hailey.com', '5413566', '12458866','4579445','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Jessica', 'Friedman', '1972-10-23'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742536', '1-5479476', '9812346696', 'jessica_friedman@gmail.com', 'www.jessica.com', '5413567', '12458867','4579446','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Victoria', 'Bland', '1972-10-24'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742537', '1-5479477', '9812346697', 'victoria_bland@gmail.com', 'www.victoria.com', '5413568', '12458868','4579447','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Jasmine', 'Swain', '1972-10-25'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742538', '1-5479478', '9812346698', 'jasmine_swain@gmail.com', 'www.jasmine.com', '5413569', '12458869','4579448','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Sydney', 'Holley', '1972-10-26'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742539', '1-5479479', '9812346699', 'sydney_holley@gmail.com', 'www.sydney.com', '5413570', '12458870','4579449','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Julia', 'Felix', '1972-10-27'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742540', '1-5479480', '9812346700', 'julia_felix@gmail.com', 'www.julia.com', '5413571', '12458871','4579450','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Destiny', 'Pearce', '1972-10-28'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742541', '1-5479481', '9812346701', 'destiny_pearce@gmail.com', 'www.destiny.com', '5413572', '12458872','4579451','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Morgan', 'Childs', '1972-10-29'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742542', '1-5479482', '9812346702', 'morgan_childs@gmail.com', 'www.morgan.com', '5413573', '12458873','4579452','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Kaitlyn', 'Yarbrough', '1972-10-30'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742543', '1-5479483', '9812346703', 'kaitlyn_yarbrough@gmail.com', 'www.kaitlyn.com', '5413574', '12458874','4579453','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Savannah', 'Galvan', '1972-10-31'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742544', '1-5479484', '9812346704', 'savannah_galvan@gmail.com', 'www.savannah.com', '5413575', '12458875','4579454','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Katherine', 'Proctor', '1972-11-01'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742545', '1-5479485', '9812346705', 'katherine_proctor@gmail.com', 'www.katherine.com', '5413576', '12458876','4579455','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Alexandra', 'Meeks', '1972-11-02'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742546', '1-5479486', '9812346706', 'alexandra_meeks@gmail.com', 'www.alexandra.com', '5413577', '12458877','4579456','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Rachel', 'Lozano', '1972-11-03'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742547', '1-5479487', '9812346707', 'rachel_lozano@gmail.com', 'www.rachel.com', '5413578', '12458878','4579457','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Lily', 'Mora', '1972-11-04'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742548', '1-5479488', '9812346708', 'lily_mora@gmail.com', 'www.lily.com', '5413579', '12458879','4579458','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Megan', 'Rangel', '1972-11-05'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742549', '1-5479489', '9812346709', 'megan_rangel@gmail.com', 'www.megan.com', '5413580', '12458880','4579459','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Kaylee', 'Bacon', '1972-11-06'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742550', '1-5479490', '9812346710', 'kaylee_bacon@gmail.com', 'www.kaylee.com', '5413581', '12458881','4579460','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Jennifer', 'Villanueva', '1972-11-07'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742551', '1-5479491', '9812346711', 'jennifer_villanueva@gmail.com', 'www.jennifer.com', '5413582', '12458882','4579461','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Angelina', 'Schaefer', '1972-11-08'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742552', '1-5479492', '9812346712', 'angelina_schaefer@gmail.com', 'www.angelina.com', '5413583', '12458883','4579462','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Makayla', 'Rosado', '1972-11-09'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742553', '1-5479493', '9812346713', 'makayla_rosado@gmail.com', 'www.makayla.com', '5413584', '12458884','4579463','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Allison', 'Helms', '1972-11-10'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742554', '1-5479494', '9812346714', 'allison_helms@gmail.com', 'www.allison.com', '5413585', '12458885','4579464','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Brooke', 'Boyce', '1972-11-11'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742555', '1-5479495', '9812346715', 'brooke_boyce@gmail.com', 'www.brooke.com', '5413586', '12458886','4579465','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Maria', 'Goss', '1972-11-12'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742556', '1-5479496', '9812346716', 'maria_goss@gmail.com', 'www.maria.com', '5413587', '12458887','4579466','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Trinity', 'Stinson', '1972-11-13'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742557', '1-5479497', '9812346717', 'trinity_stinson@gmail.com', 'www.trinity.com', '5413588', '12458888','4579467','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Lillian', 'Smart', '1972-11-14'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742558', '1-5479498', '9812346718', 'lillian_smart@gmail.com', 'www.lillian.com', '5413589', '12458889','4579468','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Mackenzie', 'Lake', '1972-11-15'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742559', '1-5479499', '9812346719', 'mackenzie_lake@gmail.com', 'www.mackenzie.com', '5413590', '12458890','4579469','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Faith', 'Ibarra', '1972-11-16'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742560', '1-5479500', '9812346720', 'faith_ibarra@gmail.com', 'www.faith.com', '5413591', '12458891','4579470','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Sofia', 'Hutchins', '1972-11-17'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742561', '1-5479501', '9812346721', 'sofia_hutchins@gmail.com', 'www.sofia.com', '5413592', '12458892','4579471','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Riley', 'Covington', '1972-11-18'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742562', '1-5479502', '9812346722', 'riley_covington@gmail.com', 'www.riley.com', '5413593', '12458893','4579472','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Haley', 'Reyna', '1972-11-19'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742563', '1-5479503', '9812346723', 'haley_reyna@gmail.com', 'www.haley.com', '5413594', '12458894','4579473','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Gabrielle', 'Gregg', '1972-11-20'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742564', '1-5479504', '9812346724', 'gabrielle_gregg@gmail.com', 'www.gabrielle.com', '5413595', '12458895','4579474','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Nicole', 'Werner', '1972-11-21'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742565', '1-5479505', '9812346725', 'nicole_werner@gmail.com', 'www.nicole.com', '5413596', '12458896','4579475','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Kylie', 'Crowley', '1972-11-22'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742566', '1-5479506', '9812346726', 'kylie_crowley@gmail.com', 'www.kylie.com', '5413597', '12458897','4579476','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Katelyn', 'Hatcher', '1972-11-23'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742567', '1-5479507', '9812346727', 'katelyn_hatcher@gmail.com', 'www.katelyn.com', '5413598', '12458898','4579477','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Zoe', 'Mackey', '1972-11-24'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742568', '1-5479508', '9812346728', 'zoe_mackey@gmail.com', 'www.zoe.com', '5413599', '12458899','4579478','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Paige', 'Bunch', '1972-11-25'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742569', '1-5479509', '9812346729', 'paige_bunch@gmail.com', 'www.paige.com', '5413600', '12458900','4579479','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Gabriella', 'Womack', '1972-11-26'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742570', '1-5479510', '9812346730', 'gabriella_womack@gmail.com', 'www.gabriella.com', '5413601', '12458901','4579480','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Jenna', 'Polk', '1972-11-27'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742571', '1-5479511', '9812346731', 'jenna_polk@gmail.com', 'www.jenna.com', '5413602', '12458902','4579481','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Kimberly', 'Jamison', '1972-11-28'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742572', '1-5479512', '9812346732', 'kimberly_jamison@gmail.com', 'www.kimberly.com', '5413603', '12458903','4579482','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Stephanie', 'Dodd', '1972-11-29'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742573', '1-5479513', '9812346733', 'stephanie_dodd@gmail.com', 'www.stephanie.com', '5413604', '12458904','4579483','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Alexa', 'Childress', '1972-11-30'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742574', '1-5479514', '9812346734', 'alexa_childress@gmail.com', 'www.alexa.com', '5413605', '12458905','4579484','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Avery', 'Childers', '1972-12-01'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742575', '1-5479515', '9812346735', 'avery_childers@gmail.com', 'www.avery.com', '5413606', '12458906','4579485','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Andrea', 'Camp', '1972-12-02'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742576', '1-5479516', '9812346736', 'andrea_camp@gmail.com', 'www.andrea.com', '5413607', '12458907','4579486','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Leah', 'Villa', '1972-12-03'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742577', '1-5479517', '9812346737', 'leah_villa@gmail.com', 'www.leah.com', '5413608', '12458908','4579487','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Madeline', 'Dye', '1972-12-04'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742578', '1-5479518', '9812346738', 'madeline_dye@gmail.com', 'www.madeline.com', '5413609', '12458909','4579488','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Nevaeh', 'Springer', '1972-12-05'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742579', '1-5479519', '9812346739', 'nevaeh_springer@gmail.com', 'www.nevaeh.com', '5413610', '12458910','4579489','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Evelyn', 'Mahoney', '1972-12-06'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742580', '1-5479520', '9812346740', 'evelyn_mahoney@gmail.com', 'www.evelyn.com', '5413611', '12458911','4579490','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Maya', 'Dailey', '1972-12-07'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742581', '1-5479521', '9812346741', 'maya_dailey@gmail.com', 'www.maya.com', '5413612', '12458912','4579491','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Mary', 'Belcher', '1972-12-08'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742582', '1-5479522', '9812346742', 'mary_belcher@gmail.com', 'www.mary.com', '5413613', '12458913','4579492','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Michelle', 'Lockhart', '1972-12-09'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742583', '1-5479523', '9812346743', 'michelle_lockhart@gmail.com', 'www.michelle.com', '5413614', '12458914','4579493','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Jada', 'Griggs', '1972-12-10'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742584', '1-5479524', '9812346744', 'jada_griggs@gmail.com', 'www.jada.com', '5413615', '12458915','4579494','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Sara', 'Costa', '1972-12-11'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742585', '1-5479525', '9812346745', 'sara_costa@gmail.com', 'www.sara.com', '5413616', '12458916','4579495','f'::boolean,0,0,'t'::boolean,5,3,15 UNION ALL +SELECT 1, 'Audrey', 'Connor', '1972-12-12'::date, 'Yuma', ' Colorado', ' USA', 'Yuma Colorado USA', '1-5742586', '1-5479526', '9812346746', 'audrey_connor@gmail.com', 'www.audrey.com', '5413617', '12458917','4579496','f'::boolean,0,0,'t'::boolean,5,3,15; + + +UPDATE core.parties +SET party_name = REPLACE(TRIM(COALESCE(last_name, '') || ', ' || first_name || ' ' || COALESCE(middle_name, '')), ' ', ''); + +ALTER TABLE core.parties +DROP column shipping_address; + diff --git a/MixERP.Net.FrontEnd/db/en-US/sample-data.sql b/MixERP.Net.FrontEnd/db/en-US/sample-data.sql new file mode 100644 index 000000000..3fb34efa8 --- /dev/null +++ b/MixERP.Net.FrontEnd/db/en-US/sample-data.sql @@ -0,0 +1,43 @@ +/******************************************************************************** +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/. +***********************************************************************************/ + +INSERT INTO core.items(item_code, item_name, item_group_id, brand_id, preferred_supplier_id, unit_id, hot_item, tax_id, reorder_level, maintain_stock, cost_price, selling_price) +SELECT 'ITP', 'IBM Thinkpadd II Laptop', 1, 1, 1, 1, 'No', 1, 10, 'Yes', 80000, 125000; + +INSERT INTO core.items(item_code, item_name, item_group_id, brand_id, preferred_supplier_id, unit_id, hot_item, tax_id, reorder_level, maintain_stock, cost_price, selling_price) +SELECT 'AIT', 'Acer Iconia Tab', 1, 1, 1, 1, 'Yes', 1, 10, 'Yes', 40000, 65000; + +INSERT INTO core.items(item_code, item_name, item_group_id, brand_id, preferred_supplier_id, unit_id, hot_item, tax_id, reorder_level, maintain_stock, cost_price, selling_price) +SELECT 'IXM', 'Intex Mouse', 1, 1, 1, 1, 'No', 1, 10, 'Yes', 200, 350; + +INSERT INTO core.items(item_code, item_name, item_group_id, brand_id, preferred_supplier_id, unit_id, hot_item, tax_id, reorder_level, maintain_stock, cost_price, selling_price) +SELECT 'MSO', 'Microsoft Office Premium Edition', 1, 1, 1, 1, 'Yes', 1, 10, 'Yes', 30000, 35000; + +INSERT INTO core.items(item_code, item_name, item_group_id, brand_id, preferred_supplier_id, unit_id, hot_item, tax_id, reorder_level, maintain_stock, cost_price, selling_price) +SELECT 'LBS', 'Lotus Banking Solution', 1, 1, 1, 1, 'Yes', 1, 10, 'No', 150000, 150000; + +INSERT INTO core.items(item_code, item_name, item_group_id, brand_id, preferred_supplier_id, unit_id, hot_item, tax_id, reorder_level, maintain_stock, cost_price, selling_price) +SELECT 'CAS', 'CAS Banking Solution', 1, 1, 1, 1, 'Yes', 1, 10, 'No', 40000, 40000; + +INSERT INTO core.items(item_code, item_name, item_group_id, brand_id, preferred_supplier_id, unit_id, hot_item, tax_id, reorder_level, maintain_stock, cost_price, selling_price) +SELECT 'SGT', 'Samsung Galaxy Tab 10.1', 1, 1, 1, 1, 'No', 1, 10, 'Yes', 30000, 45000; + + +INSERT INTO office.stores(office_id, store_code, store_name, address, store_type_id, allow_sales) +SELECT 1, 'STORE-1', 'Store 1', 'Office', 2, true UNION ALL +SELECT 1, 'GODOW-1', 'Godown 1', 'Office', 2, false; + +INSERT INTO office.cash_repositories(office_id, cash_repository_code, cash_repository_name, description) +SELECT 2, 'DRW1', 'Drawer 1', 'Drawer' UNION ALL +SELECT 2, 'VLT', 'Vault', 'Vault'; + + + +INSERT INTO core.shippers(company_name, account_id) +SELECT 'Default', core.get_account_id_by_account_code('20110'); + diff --git a/MixERP.Net.FrontEnd/index.html b/MixERP.Net.FrontEnd/index.html new file mode 100644 index 000000000..a9f760e36 --- /dev/null +++ b/MixERP.Net.FrontEnd/index.html @@ -0,0 +1,31 @@ + + + MixErp + + + + + . . . + + + + + + + + + + + + + + + + + + diff --git a/MixERP.Net.FrontEnd/spinner.gif b/MixERP.Net.FrontEnd/spinner.gif new file mode 100644 index 000000000..bad79a9f7 Binary files /dev/null and b/MixERP.Net.FrontEnd/spinner.gif differ diff --git a/MixERP.Net.FrontEnd/web.config.backup b/MixERP.Net.FrontEnd/web.config.backup new file mode 100644 index 000000000..2276efdef --- /dev/null +++ b/MixERP.Net.FrontEnd/web.config.backup @@ -0,0 +1,78 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/MixERP.Net.psess b/MixERP.Net.psess new file mode 100644 index 000000000..0519750d8 --- /dev/null +++ b/MixERP.Net.psess @@ -0,0 +1,76 @@ + + + + MixERP.Net.sln + Sampling + Life + Performance Explorer Reports\MixERP.net.FrontEnd.vsp + true + true + Timestamp + Cycles + 10000000 + 10 + 10 + + false + + + + false + 500 + + \Memory\Pages/sec + \PhysicalDisk(_Total)\Avg. Disk Queue Length + \Processor(_Total)\% Processor Time + + + + true + false + false + + false + + + false + + + + MixERP.net.FrontEnd\\bin\MixERP.Net.FrontEnd.dll + 01/01/0001 00:00:00 + true + true + false + false + false + false + false + true + false + Browser + http://localhost:0/ + http://localhost:0/ + D:\Development\Big Projects\MixERP\MixERP.net.FrontEnd\ + / + VWD + InternetExplorer + true + false + + false + + + false + + {ACE1017D-71BC-4417-A906-72C4B9C55823}|MixERP.Net.FrontEnd\MixERP.Net.FrontEnd.csproj + MixERP.net.FrontEnd\MixERP.Net.FrontEnd.csproj + MixERP.Net.FrontEnd + + + + + :PB:{ACE1017D-71BC-4417-A906-72C4B9C55823}|MixERP.Net.FrontEnd\MixERP.Net.FrontEnd.csproj + + + \ No newline at end of file diff --git a/MixERP.Net.sln b/MixERP.Net.sln new file mode 100644 index 000000000..ce9dfc9dd --- /dev/null +++ b/MixERP.Net.sln @@ -0,0 +1,147 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 2012 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MixERP.Net.BusinessLayer", "MixERP.net.BusinessLayer\MixERP.Net.BusinessLayer.csproj", "{81DE04CF-7DE9-42FF-8339-D05E2586DCBA}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MixERP.Net.Common", "MixERP.net.Common\MixERP.Net.Common.csproj", "{D5A09C22-8F48-4FB2-A14D-C62C8C8FCEC0}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MixERP.Net.DatabaseLayer", "MixERP.net.DatabaseLayer\MixERP.Net.DatabaseLayer.csproj", "{F1F6FB95-5D7E-4E4C-9CC4-AC58DBD8F09F}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MixERP.Net.FrontEnd", "MixERP.net.FrontEnd\MixERP.Net.FrontEnd.csproj", "{ACE1017D-71BC-4417-A906-72C4B9C55823}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tests", "Tests", "{B331910C-E400-4F2D-AAD1-14D73811E81C}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MixERP.Net.DatabaseLayer.UnitTest", "Tests\Unit Tests\MixERP.Net.DatabaseLayer.UnitTest\MixERP.Net.DatabaseLayer.UnitTest.csproj", "{AF6AC722-C81A-4590-9FAC-6124A775A511}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MixERP.Net.BusinessLayer.UnitTest", "Tests\Unit Tests\MixERP.Net.BusinessLayer.UnitTest\MixERP.Net.BusinessLayer.UnitTest.csproj", "{8D64F21A-2614-40DB-8045-BD4CCA211BB5}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Unit Tests", "Unit Tests", "{B6583396-81BE-4A68-91C9-6966E58563F5}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MixERP.Net.Common.UnitTest", "Tests\Unit Tests\MixERP.Net.Common.UnitTest\MixERP.Net.Common.UnitTest.csproj", "{E247D44C-B0B8-4A6E-9741-3898B882A2A0}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MixERP.Net.FrontEnd.UnitTest", "Tests\Unit Tests\MixERP.Net.FrontEnd.UnitTest\MixERP.Net.FrontEnd.UnitTest.csproj", "{F60E576B-39C3-4523-B308-A6787BF4FEAC}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Pes.Utility.UnitTest", "Tests\Unit Tests\Pes.Utility.UnitTest\Pes.Utility.UnitTest.csproj", "{90264B76-326C-414F-96B0-581DE4A88149}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Web Performance Tests", "Web Performance Tests", "{62698506-0C89-463C-82E7-33521D1B055C}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MixERP.Net.FrontEnd.WebTest", "Tests\Web Tests\MixERP.Net.FrontEnd.WebTest\MixERP.Net.FrontEnd.WebTest.csproj", "{D072AEBC-C96A-438C-9816-F78339D37E70}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{F12F3FD9-1C35-4C76-9733-8618DA796761}" + ProjectSection(SolutionItems) = preProject + Local.testsettings = Local.testsettings + EndProjectSection +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "MixERP.Net", "MixERP.Net", "{C832E6A8-B906-4DFC-8458-72C965C0C957}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Mono-Debug|Any CPU = Mono-Debug|Any CPU + Mono-Release|Any CPU = Mono-Release|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {81DE04CF-7DE9-42FF-8339-D05E2586DCBA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {81DE04CF-7DE9-42FF-8339-D05E2586DCBA}.Debug|Any CPU.Build.0 = Debug|Any CPU + {81DE04CF-7DE9-42FF-8339-D05E2586DCBA}.Mono-Debug|Any CPU.ActiveCfg = Debug|Any CPU + {81DE04CF-7DE9-42FF-8339-D05E2586DCBA}.Mono-Debug|Any CPU.Build.0 = Debug|Any CPU + {81DE04CF-7DE9-42FF-8339-D05E2586DCBA}.Mono-Release|Any CPU.ActiveCfg = Release|Any CPU + {81DE04CF-7DE9-42FF-8339-D05E2586DCBA}.Mono-Release|Any CPU.Build.0 = Release|Any CPU + {81DE04CF-7DE9-42FF-8339-D05E2586DCBA}.Release|Any CPU.ActiveCfg = Release|Any CPU + {81DE04CF-7DE9-42FF-8339-D05E2586DCBA}.Release|Any CPU.Build.0 = Release|Any CPU + {D5A09C22-8F48-4FB2-A14D-C62C8C8FCEC0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {D5A09C22-8F48-4FB2-A14D-C62C8C8FCEC0}.Debug|Any CPU.Build.0 = Debug|Any CPU + {D5A09C22-8F48-4FB2-A14D-C62C8C8FCEC0}.Mono-Debug|Any CPU.ActiveCfg = Debug|Any CPU + {D5A09C22-8F48-4FB2-A14D-C62C8C8FCEC0}.Mono-Debug|Any CPU.Build.0 = Debug|Any CPU + {D5A09C22-8F48-4FB2-A14D-C62C8C8FCEC0}.Mono-Release|Any CPU.ActiveCfg = Release|Any CPU + {D5A09C22-8F48-4FB2-A14D-C62C8C8FCEC0}.Mono-Release|Any CPU.Build.0 = Release|Any CPU + {D5A09C22-8F48-4FB2-A14D-C62C8C8FCEC0}.Release|Any CPU.ActiveCfg = Release|Any CPU + {D5A09C22-8F48-4FB2-A14D-C62C8C8FCEC0}.Release|Any CPU.Build.0 = Release|Any CPU + {F1F6FB95-5D7E-4E4C-9CC4-AC58DBD8F09F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {F1F6FB95-5D7E-4E4C-9CC4-AC58DBD8F09F}.Debug|Any CPU.Build.0 = Debug|Any CPU + {F1F6FB95-5D7E-4E4C-9CC4-AC58DBD8F09F}.Mono-Debug|Any CPU.ActiveCfg = Debug|Any CPU + {F1F6FB95-5D7E-4E4C-9CC4-AC58DBD8F09F}.Mono-Debug|Any CPU.Build.0 = Debug|Any CPU + {F1F6FB95-5D7E-4E4C-9CC4-AC58DBD8F09F}.Mono-Release|Any CPU.ActiveCfg = Release|Any CPU + {F1F6FB95-5D7E-4E4C-9CC4-AC58DBD8F09F}.Mono-Release|Any CPU.Build.0 = Release|Any CPU + {F1F6FB95-5D7E-4E4C-9CC4-AC58DBD8F09F}.Release|Any CPU.ActiveCfg = Release|Any CPU + {F1F6FB95-5D7E-4E4C-9CC4-AC58DBD8F09F}.Release|Any CPU.Build.0 = Release|Any CPU + {ACE1017D-71BC-4417-A906-72C4B9C55823}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {ACE1017D-71BC-4417-A906-72C4B9C55823}.Debug|Any CPU.Build.0 = Debug|Any CPU + {ACE1017D-71BC-4417-A906-72C4B9C55823}.Mono-Debug|Any CPU.ActiveCfg = Debug|Any CPU + {ACE1017D-71BC-4417-A906-72C4B9C55823}.Mono-Debug|Any CPU.Build.0 = Debug|Any CPU + {ACE1017D-71BC-4417-A906-72C4B9C55823}.Mono-Release|Any CPU.ActiveCfg = Release|Any CPU + {ACE1017D-71BC-4417-A906-72C4B9C55823}.Mono-Release|Any CPU.Build.0 = Release|Any CPU + {ACE1017D-71BC-4417-A906-72C4B9C55823}.Release|Any CPU.ActiveCfg = Release|Any CPU + {ACE1017D-71BC-4417-A906-72C4B9C55823}.Release|Any CPU.Build.0 = Release|Any CPU + {AF6AC722-C81A-4590-9FAC-6124A775A511}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {AF6AC722-C81A-4590-9FAC-6124A775A511}.Debug|Any CPU.Build.0 = Debug|Any CPU + {AF6AC722-C81A-4590-9FAC-6124A775A511}.Mono-Debug|Any CPU.ActiveCfg = Debug|Any CPU + {AF6AC722-C81A-4590-9FAC-6124A775A511}.Mono-Debug|Any CPU.Build.0 = Debug|Any CPU + {AF6AC722-C81A-4590-9FAC-6124A775A511}.Mono-Release|Any CPU.ActiveCfg = Release|Any CPU + {AF6AC722-C81A-4590-9FAC-6124A775A511}.Mono-Release|Any CPU.Build.0 = Release|Any CPU + {AF6AC722-C81A-4590-9FAC-6124A775A511}.Release|Any CPU.ActiveCfg = Release|Any CPU + {AF6AC722-C81A-4590-9FAC-6124A775A511}.Release|Any CPU.Build.0 = Release|Any CPU + {8D64F21A-2614-40DB-8045-BD4CCA211BB5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {8D64F21A-2614-40DB-8045-BD4CCA211BB5}.Debug|Any CPU.Build.0 = Debug|Any CPU + {8D64F21A-2614-40DB-8045-BD4CCA211BB5}.Mono-Debug|Any CPU.ActiveCfg = Debug|Any CPU + {8D64F21A-2614-40DB-8045-BD4CCA211BB5}.Mono-Debug|Any CPU.Build.0 = Debug|Any CPU + {8D64F21A-2614-40DB-8045-BD4CCA211BB5}.Mono-Release|Any CPU.ActiveCfg = Release|Any CPU + {8D64F21A-2614-40DB-8045-BD4CCA211BB5}.Mono-Release|Any CPU.Build.0 = Release|Any CPU + {8D64F21A-2614-40DB-8045-BD4CCA211BB5}.Release|Any CPU.ActiveCfg = Release|Any CPU + {8D64F21A-2614-40DB-8045-BD4CCA211BB5}.Release|Any CPU.Build.0 = Release|Any CPU + {E247D44C-B0B8-4A6E-9741-3898B882A2A0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {E247D44C-B0B8-4A6E-9741-3898B882A2A0}.Debug|Any CPU.Build.0 = Debug|Any CPU + {E247D44C-B0B8-4A6E-9741-3898B882A2A0}.Mono-Debug|Any CPU.ActiveCfg = Debug|Any CPU + {E247D44C-B0B8-4A6E-9741-3898B882A2A0}.Mono-Debug|Any CPU.Build.0 = Debug|Any CPU + {E247D44C-B0B8-4A6E-9741-3898B882A2A0}.Mono-Release|Any CPU.ActiveCfg = Release|Any CPU + {E247D44C-B0B8-4A6E-9741-3898B882A2A0}.Mono-Release|Any CPU.Build.0 = Release|Any CPU + {E247D44C-B0B8-4A6E-9741-3898B882A2A0}.Release|Any CPU.ActiveCfg = Release|Any CPU + {E247D44C-B0B8-4A6E-9741-3898B882A2A0}.Release|Any CPU.Build.0 = Release|Any CPU + {F60E576B-39C3-4523-B308-A6787BF4FEAC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {F60E576B-39C3-4523-B308-A6787BF4FEAC}.Debug|Any CPU.Build.0 = Debug|Any CPU + {F60E576B-39C3-4523-B308-A6787BF4FEAC}.Mono-Debug|Any CPU.ActiveCfg = Debug|Any CPU + {F60E576B-39C3-4523-B308-A6787BF4FEAC}.Mono-Debug|Any CPU.Build.0 = Debug|Any CPU + {F60E576B-39C3-4523-B308-A6787BF4FEAC}.Mono-Release|Any CPU.ActiveCfg = Release|Any CPU + {F60E576B-39C3-4523-B308-A6787BF4FEAC}.Mono-Release|Any CPU.Build.0 = Release|Any CPU + {F60E576B-39C3-4523-B308-A6787BF4FEAC}.Release|Any CPU.ActiveCfg = Release|Any CPU + {F60E576B-39C3-4523-B308-A6787BF4FEAC}.Release|Any CPU.Build.0 = Release|Any CPU + {90264B76-326C-414F-96B0-581DE4A88149}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {90264B76-326C-414F-96B0-581DE4A88149}.Debug|Any CPU.Build.0 = Debug|Any CPU + {90264B76-326C-414F-96B0-581DE4A88149}.Mono-Debug|Any CPU.ActiveCfg = Debug|Any CPU + {90264B76-326C-414F-96B0-581DE4A88149}.Mono-Debug|Any CPU.Build.0 = Debug|Any CPU + {90264B76-326C-414F-96B0-581DE4A88149}.Mono-Release|Any CPU.ActiveCfg = Release|Any CPU + {90264B76-326C-414F-96B0-581DE4A88149}.Mono-Release|Any CPU.Build.0 = Release|Any CPU + {90264B76-326C-414F-96B0-581DE4A88149}.Release|Any CPU.ActiveCfg = Release|Any CPU + {90264B76-326C-414F-96B0-581DE4A88149}.Release|Any CPU.Build.0 = Release|Any CPU + {D072AEBC-C96A-438C-9816-F78339D37E70}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {D072AEBC-C96A-438C-9816-F78339D37E70}.Debug|Any CPU.Build.0 = Debug|Any CPU + {D072AEBC-C96A-438C-9816-F78339D37E70}.Mono-Debug|Any CPU.ActiveCfg = Debug|Any CPU + {D072AEBC-C96A-438C-9816-F78339D37E70}.Mono-Debug|Any CPU.Build.0 = Debug|Any CPU + {D072AEBC-C96A-438C-9816-F78339D37E70}.Mono-Release|Any CPU.ActiveCfg = Release|Any CPU + {D072AEBC-C96A-438C-9816-F78339D37E70}.Mono-Release|Any CPU.Build.0 = Release|Any CPU + {D072AEBC-C96A-438C-9816-F78339D37E70}.Release|Any CPU.ActiveCfg = Release|Any CPU + {D072AEBC-C96A-438C-9816-F78339D37E70}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(NestedProjects) = preSolution + {D5A09C22-8F48-4FB2-A14D-C62C8C8FCEC0} = {C832E6A8-B906-4DFC-8458-72C965C0C957} + {F1F6FB95-5D7E-4E4C-9CC4-AC58DBD8F09F} = {C832E6A8-B906-4DFC-8458-72C965C0C957} + {ACE1017D-71BC-4417-A906-72C4B9C55823} = {C832E6A8-B906-4DFC-8458-72C965C0C957} + {81DE04CF-7DE9-42FF-8339-D05E2586DCBA} = {C832E6A8-B906-4DFC-8458-72C965C0C957} + {B6583396-81BE-4A68-91C9-6966E58563F5} = {B331910C-E400-4F2D-AAD1-14D73811E81C} + {62698506-0C89-463C-82E7-33521D1B055C} = {B331910C-E400-4F2D-AAD1-14D73811E81C} + {8D64F21A-2614-40DB-8045-BD4CCA211BB5} = {B6583396-81BE-4A68-91C9-6966E58563F5} + {AF6AC722-C81A-4590-9FAC-6124A775A511} = {B6583396-81BE-4A68-91C9-6966E58563F5} + {E247D44C-B0B8-4A6E-9741-3898B882A2A0} = {B6583396-81BE-4A68-91C9-6966E58563F5} + {F60E576B-39C3-4523-B308-A6787BF4FEAC} = {B6583396-81BE-4A68-91C9-6966E58563F5} + {90264B76-326C-414F-96B0-581DE4A88149} = {B6583396-81BE-4A68-91C9-6966E58563F5} + {D072AEBC-C96A-438C-9816-F78339D37E70} = {62698506-0C89-463C-82E7-33521D1B055C} + {F12F3FD9-1C35-4C76-9733-8618DA796761} = {62698506-0C89-463C-82E7-33521D1B055C} + EndGlobalSection + GlobalSection(Performance) = preSolution + HasPerformanceSessions = true + EndGlobalSection +EndGlobal diff --git a/MixERP.Net.userprefs b/MixERP.Net.userprefs new file mode 100644 index 000000000..8a063dbf7 --- /dev/null +++ b/MixERP.Net.userprefs @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/MixERP.ruleset b/MixERP.ruleset new file mode 100644 index 000000000..6d9c90a98 --- /dev/null +++ b/MixERP.ruleset @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + \ No newline at end of file diff --git a/README.md b/README.md index 0e1d589d4..e69de29bb 100644 --- a/README.md +++ b/README.md @@ -1,4 +0,0 @@ -mixerp -====== - -ASP.net Open Source ERP diff --git a/Readme.txt b/Readme.txt new file mode 100644 index 000000000..e0e73aa71 --- /dev/null +++ b/Readme.txt @@ -0,0 +1,69 @@ +Hello there, + +MixERP is a feature rich, easy to use, open source ERP solution which is still in alpha stage. + +------------------------------------------------------------------------------------------------------------------------------------------------- + Installing the database: +------------------------------------------------------------------------------------------------------------------------------------------------- + +MixERP uses the powerful, award-winning, highly stable, and objected oriented database PostgreSQL. PostgreSQL server is an open source +database server, which can be downloaded from: + +http://postgresql.org + + +Please run the following database scripts under the directory "/MixERP.Net.FrontEnd/db/en-US/", in this order: + +1. mixerp.sql +2. mixerp-db-logic.sql +3. party-sample.sql (optional) +4. sample-data.sql (optional) + + +**Please Note:** +If you are using PostgreSQL 9.2 and below, you would have to make a very minor change to +the SQL script "customer-sample.sql": + +1. Find the word 'MATERIALIZED VIEW' and replace that with 'VIEW'. +2. Comment out all the lines starting with 'REFRESH MATERIALIZED VIEW'. + + +------------------------------------------------------------------------------------------------------------------------------------------------- +Non English Speaking Countries: +------------------------------------------------------------------------------------------------------------------------------------------------- +MixERP is a multilingual product by design. Instead of hardcoding everying, we maintain a central resource file respository +on the directory "MixERP.Net.FrontEnd/App_GlobalResources". + +Please find the following files: + +Titles.resx +-Titles and only titles should be stored in this file, complying to the rules of capitalization. +-Resource keys: use ProperCasing. + +Questions.resx +-Questions are stored in this file. +-Resource keys: ProperCasing. + +Labels.resx +-Field labels are stored here. Must be a complete sentence or meaningful phrase. +-Resource keys: use ProperCasing. + +Warnings.resx +-Application warnings are stored here. Must be a complete sentence or meaningful phrase. +-Resource keys: use ProperCasing. + +Setup.resx +-System resource. +-Resource keys: use ProperCasing. + + +FormResource.resx +-PostgreSQL columns are stored as resource keys. These are used on dynamically generated forms and reports. +-Resource keys: use lowercase_underscore_separator. + +------------------------------------------------------------------------------------------------------------------------------------------------- + + +Watch out for more ... + +MixERP team. \ No newline at end of file diff --git a/Tests/Unit Tests/MixERP.Net.BusinessLayer.UnitTest/MixERP.Net.BusinessLayer.UnitTest.csproj b/Tests/Unit Tests/MixERP.Net.BusinessLayer.UnitTest/MixERP.Net.BusinessLayer.UnitTest.csproj new file mode 100644 index 000000000..a94629ad2 --- /dev/null +++ b/Tests/Unit Tests/MixERP.Net.BusinessLayer.UnitTest/MixERP.Net.BusinessLayer.UnitTest.csproj @@ -0,0 +1,82 @@ + + + + Debug + AnyCPU + {8D64F21A-2614-40DB-8045-BD4CCA211BB5} + Library + Properties + MixERP.Net.BusinessLayer.UnitTest + MixERP.Net.BusinessLayer.UnitTest + v4.5 + 512 + {3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + 10.0 + $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) + $(ProgramFiles)\Common Files\microsoft shared\VSTT\$(VisualStudioVersion)\UITestExtensionPackages + False + UnitTest + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + + + + + + + + + + + + + + + False + + + False + + + False + + + False + + + + + + + + \ No newline at end of file diff --git a/Tests/Unit Tests/MixERP.Net.BusinessLayer.UnitTest/Properties/AssemblyInfo.cs b/Tests/Unit Tests/MixERP.Net.BusinessLayer.UnitTest/Properties/AssemblyInfo.cs new file mode 100644 index 000000000..0de929dc9 --- /dev/null +++ b/Tests/Unit Tests/MixERP.Net.BusinessLayer.UnitTest/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("MixERP.Net.BusinessLayer.UnitTest")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("MixERP.Net.BusinessLayer.UnitTest")] +[assembly: AssemblyCopyright("Copyright © 2013")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("95c354d4-5cdf-4495-ac90-8270b328ffa5")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/Tests/Unit Tests/MixERP.Net.Common.UnitTest/MixERP.Net.Common.UnitTest.csproj b/Tests/Unit Tests/MixERP.Net.Common.UnitTest/MixERP.Net.Common.UnitTest.csproj new file mode 100644 index 000000000..ac95ffce4 --- /dev/null +++ b/Tests/Unit Tests/MixERP.Net.Common.UnitTest/MixERP.Net.Common.UnitTest.csproj @@ -0,0 +1,82 @@ + + + + Debug + AnyCPU + {E247D44C-B0B8-4A6E-9741-3898B882A2A0} + Library + Properties + MixERP.Net.Common.UnitTest + MixERP.Net.Common.UnitTest + v4.5 + 512 + {3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + 10.0 + $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) + $(ProgramFiles)\Common Files\microsoft shared\VSTT\$(VisualStudioVersion)\UITestExtensionPackages + False + UnitTest + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + + + + + + + + + + + + + + + False + + + False + + + False + + + False + + + + + + + + \ No newline at end of file diff --git a/Tests/Unit Tests/MixERP.Net.Common.UnitTest/Properties/AssemblyInfo.cs b/Tests/Unit Tests/MixERP.Net.Common.UnitTest/Properties/AssemblyInfo.cs new file mode 100644 index 000000000..a53ec2f52 --- /dev/null +++ b/Tests/Unit Tests/MixERP.Net.Common.UnitTest/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("MixERP.Net.Common.UnitTest")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("MixERP.Net.Common.UnitTest")] +[assembly: AssemblyCopyright("Copyright © 2013")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("84567b95-ddcb-4380-9ab2-614baf46d2c5")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/Tests/Unit Tests/MixERP.Net.DatabaseLayer.UnitTest/MixERP.Net.DatabaseLayer.UnitTest.csproj b/Tests/Unit Tests/MixERP.Net.DatabaseLayer.UnitTest/MixERP.Net.DatabaseLayer.UnitTest.csproj new file mode 100644 index 000000000..6b8a67e70 --- /dev/null +++ b/Tests/Unit Tests/MixERP.Net.DatabaseLayer.UnitTest/MixERP.Net.DatabaseLayer.UnitTest.csproj @@ -0,0 +1,82 @@ + + + + Debug + AnyCPU + {AF6AC722-C81A-4590-9FAC-6124A775A511} + Library + Properties + MixERP.Net.DatabaseLayer.UnitTest + MixERP.Net.DatabaseLayer.UnitTest + v4.5 + 512 + {3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + 10.0 + $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) + $(ProgramFiles)\Common Files\microsoft shared\VSTT\$(VisualStudioVersion)\UITestExtensionPackages + False + UnitTest + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + + + + + + + + + + + + + + + False + + + False + + + False + + + False + + + + + + + + \ No newline at end of file diff --git a/Tests/Unit Tests/MixERP.Net.DatabaseLayer.UnitTest/Properties/AssemblyInfo.cs b/Tests/Unit Tests/MixERP.Net.DatabaseLayer.UnitTest/Properties/AssemblyInfo.cs new file mode 100644 index 000000000..0b685e025 --- /dev/null +++ b/Tests/Unit Tests/MixERP.Net.DatabaseLayer.UnitTest/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("MixERP.Net.DatabaseLayer.UnitTest")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("MixERP.Net.DatabaseLayer.UnitTest")] +[assembly: AssemblyCopyright("Copyright © 2013")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("edeb2d8d-d76f-4291-85a8-ff3cf98c435c")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/Tests/Unit Tests/MixERP.Net.FrontEnd.UnitTest/MixERP.Net.FrontEnd.UnitTest.csproj b/Tests/Unit Tests/MixERP.Net.FrontEnd.UnitTest/MixERP.Net.FrontEnd.UnitTest.csproj new file mode 100644 index 000000000..8c2c89bb9 --- /dev/null +++ b/Tests/Unit Tests/MixERP.Net.FrontEnd.UnitTest/MixERP.Net.FrontEnd.UnitTest.csproj @@ -0,0 +1,82 @@ + + + + Debug + AnyCPU + {F60E576B-39C3-4523-B308-A6787BF4FEAC} + Library + Properties + MixERP.Net.FrontEnd.UnitTest + MixERP.Net.FrontEnd.UnitTest + v4.5 + 512 + {3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + 10.0 + $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) + $(ProgramFiles)\Common Files\microsoft shared\VSTT\$(VisualStudioVersion)\UITestExtensionPackages + False + UnitTest + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + + + + + + + + + + + + + + + False + + + False + + + False + + + False + + + + + + + + \ No newline at end of file diff --git a/Tests/Unit Tests/MixERP.Net.FrontEnd.UnitTest/Properties/AssemblyInfo.cs b/Tests/Unit Tests/MixERP.Net.FrontEnd.UnitTest/Properties/AssemblyInfo.cs new file mode 100644 index 000000000..0ea4dfbaf --- /dev/null +++ b/Tests/Unit Tests/MixERP.Net.FrontEnd.UnitTest/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("MixERP.Net.FrontEnd.UnitTest")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("MixERP.Net.FrontEnd.UnitTest")] +[assembly: AssemblyCopyright("Copyright © 2013")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("02305af9-fc1b-4a65-ad37-bc86b14a020f")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/Tests/Unit Tests/Pes.Utility.UnitTest/Pes.Utility.UnitTest.csproj b/Tests/Unit Tests/Pes.Utility.UnitTest/Pes.Utility.UnitTest.csproj new file mode 100644 index 000000000..d2f8b1dc7 --- /dev/null +++ b/Tests/Unit Tests/Pes.Utility.UnitTest/Pes.Utility.UnitTest.csproj @@ -0,0 +1,82 @@ + + + + Debug + AnyCPU + {90264B76-326C-414F-96B0-581DE4A88149} + Library + Properties + Pes.Utility.UnitTest + Pes.Utility.UnitTest + v4.5 + 512 + {3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + 10.0 + $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) + $(ProgramFiles)\Common Files\microsoft shared\VSTT\$(VisualStudioVersion)\UITestExtensionPackages + False + UnitTest + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + + + + + + + + + + + + + + + False + + + False + + + False + + + False + + + + + + + + \ No newline at end of file diff --git a/Tests/Unit Tests/Pes.Utility.UnitTest/Properties/AssemblyInfo.cs b/Tests/Unit Tests/Pes.Utility.UnitTest/Properties/AssemblyInfo.cs new file mode 100644 index 000000000..cd4e0b094 --- /dev/null +++ b/Tests/Unit Tests/Pes.Utility.UnitTest/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("MixERP.Net.Common.UnitTest")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("MixERP.Net.Common.UnitTest")] +[assembly: AssemblyCopyright("Copyright © 2013")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("97a7bd2e-84be-476c-a52d-85eb6780c29c")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/Tests/Web Tests/MixERP.Net.FrontEnd.WebTest/MixERP.Net.FrontEnd.WebTest.csproj b/Tests/Web Tests/MixERP.Net.FrontEnd.WebTest/MixERP.Net.FrontEnd.WebTest.csproj new file mode 100644 index 000000000..d44fc88f0 --- /dev/null +++ b/Tests/Web Tests/MixERP.Net.FrontEnd.WebTest/MixERP.Net.FrontEnd.WebTest.csproj @@ -0,0 +1,84 @@ + + + + Debug + AnyCPU + + + 2.0 + {D072AEBC-C96A-438C-9816-F78339D37E70} + Library + Properties + MixERP.Net.FrontEnd.WebTest + MixERP.Net.FrontEnd.WebTest + v4.5 + 512 + {3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + WebTest + 10.0 + $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) + $(ProgramFiles)\Common Files\microsoft shared\VSTT\$(VisualStudioVersion)\UITestExtensionPackages + False + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + False + + + + + + + + PreserveNewest + + + + + + + False + + + False + + + False + + + False + + + + + + + + \ No newline at end of file diff --git a/Tests/Web Tests/MixERP.Net.FrontEnd.WebTest/Properties/AssemblyInfo.cs b/Tests/Web Tests/MixERP.Net.FrontEnd.WebTest/Properties/AssemblyInfo.cs new file mode 100644 index 000000000..404a1d823 --- /dev/null +++ b/Tests/Web Tests/MixERP.Net.FrontEnd.WebTest/Properties/AssemblyInfo.cs @@ -0,0 +1,35 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("MixERP.Net.FrontEnd.WebTest")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("MixERP.Net.FrontEnd.WebTest")] +[assembly: AssemblyCopyright("Copyright © 2013")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("2e93c038-4b51-474d-965f-05965f08ce93")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/Tests/Web Tests/MixERP.Net.FrontEnd.WebTest/WebTest1.webtest b/Tests/Web Tests/MixERP.Net.FrontEnd.WebTest/WebTest1.webtest new file mode 100644 index 000000000..668e050bd --- /dev/null +++ b/Tests/Web Tests/MixERP.Net.FrontEnd.WebTest/WebTest1.webtest @@ -0,0 +1,2 @@ + + \ No newline at end of file